Changeset 973ef9fc in mainline for uspace/drv/test1/char.c


Ignore:
Timestamp:
2010-12-25T21:20:28Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
631ee0c
Parents:
1bfd3d3 (diff), 09178b7f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/drv/test1/char.c

    r1bfd3d3 r973ef9fc  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2010 Vojtech Horky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libpacket
    30  * @{
    31  */
    32 
    3329/** @file
    3430 */
    3531
    36 #ifndef LIBPACKET_PACKET_LOCAL_H_
    37 #define LIBPACKET_PACKET_LOCAL_H_
     32#include <assert.h>
     33#include <errno.h>
     34#include <mem.h>
     35#include <char.h>
    3836
    39 #include <net/packet.h>
     37#include "test1.h"
    4038
    41 /** @name Packet local interface
    42  */
    43 /*@{*/
     39static int impl_char_read(device_t *dev, char *buf, size_t count) {
     40        memset(buf, 0, count);
     41        return count;
     42}
    4443
    45 extern int packet_translate_local(int, packet_t *, packet_id_t);
    46 extern packet_t packet_get_4_local(int, size_t, size_t, size_t, size_t);
    47 extern packet_t packet_get_1_local(int, size_t);
    48 extern void pq_release_local(int, packet_id_t);
     44static int imp_char_write(device_t *dev, char *buf, size_t count) {
     45        return count;
     46}
    4947
    50 /*@}*/
     48static char_iface_t char_interface = {
     49        .read = &impl_char_read,
     50        .write = &imp_char_write
     51};
    5152
    52 #endif
     53device_ops_t char_device_ops = {
     54        .interfaces[CHAR_DEV_IFACE] = &char_interface
     55};
    5356
    54 /** @}
    55  */
Note: See TracChangeset for help on using the changeset viewer.