Subversion Repositories HelenOS

Rev

Rev 4743 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4743 Rev 4756
Line 59... Line 59...
59
 *  This interface is used by other modules.
59
 *  This interface is used by other modules.
60
 */
60
 */
61
/*@{*/
61
/*@{*/
62
 
62
 
63
/** Returns the device local hardware address.
63
/** Returns the device local hardware address.
64
 *  @param nil_phone The network interface layer phone. Input parameter.
64
 *  @param[in] nil_phone The network interface layer phone.
65
 *  @param device_id The device identifier. Input parameter.
65
 *  @param[in] device_id The device identifier.
66
 *  @param address The device local hardware address. Output parameter.
66
 *  @param[out] address The device local hardware address.
67
 *  @param data The address data. Output parameter.
67
 *  @param[out] data The address data.
68
 *  @returns EOK on success.
68
 *  @returns EOK on success.
69
 *  @returns EBADMEM if the address parameter is NULL.
69
 *  @returns EBADMEM if the address parameter and/or the data parameter is NULL.
70
 *  @returns ENOENT if there no such device.
70
 *  @returns ENOENT if there no such device.
71
 *  @returns Other error codes as defined for the generic_get_addr_req() function.
71
 *  @returns Other error codes as defined for the generic_get_addr_req() function.
72
 */
72
 */
73
#define nil_get_addr_req( nil_phone, device_id, address, data ) \
73
#define nil_get_addr_req( nil_phone, device_id, address, data ) \
74
    generic_get_addr_req( nil_phone, NET_NIL_ADDR, device_id, address, data )
74
    generic_get_addr_req( nil_phone, NET_NIL_ADDR, device_id, address, data )
75
 
75
 
76
/** Returns the device broadcast hardware address.
76
/** Returns the device broadcast hardware address.
77
 *  @param nil_phone The network interface layer phone. Input parameter.
77
 *  @param[in] nil_phone The network interface layer phone.
78
 *  @param device_id The device identifier. Input parameter.
78
 *  @param[in] device_id The device identifier.
79
 *  @param address The device broadcast hardware address. Output parameter.
79
 *  @param[out] address The device broadcast hardware address.
80
 *  @param data The address data. Output parameter.
80
 *  @param[out] data The address data.
81
 *  @returns EOK on success.
81
 *  @returns EOK on success.
82
 *  @returns EBADMEM if the address parameter is NULL.
82
 *  @returns EBADMEM if the address parameter is NULL.
83
 *  @returns ENOENT if there no such device.
83
 *  @returns ENOENT if there no such device.
84
 *  @returns Other error codes as defined for the generic_get_addr_req() function.
84
 *  @returns Other error codes as defined for the generic_get_addr_req() function.
85
 */
85
 */
86
#define nil_get_broadcast_addr_req( nil_phone, device_id, address, data )   \
86
#define nil_get_broadcast_addr_req( nil_phone, device_id, address, data )   \
87
    generic_get_addr_req( nil_phone, NET_NIL_BROADCAST_ADDR, device_id, address, data )
87
    generic_get_addr_req( nil_phone, NET_NIL_BROADCAST_ADDR, device_id, address, data )
88
 
88
 
89
/** Sends the packet queue.
89
/** Sends the packet queue.
90
 *  @param nil_phone The network interface layer phone. Input parameter.
90
 *  @param[in] nil_phone The network interface layer phone.
91
 *  @param device_id The device identifier. Input parameter.
91
 *  @param[in] device_id The device identifier.
92
 *  @param packet The packet queue. Input parameter.
92
 *  @param[in] packet The packet queue.
93
 *  @param sender The sending module service. Input parameter.
93
 *  @param[in] sender The sending module service.
94
 *  @returns EOK on success.
94
 *  @returns EOK on success.
95
 *  @returns Other error codes as defined for the generic_send_msg() function.
95
 *  @returns Other error codes as defined for the generic_send_msg() function.
96
 */
96
 */
97
#define nil_send_msg( nil_phone, device_id, packet, sender )    \
97
#define nil_send_msg( nil_phone, device_id, packet, sender )    \
98
    generic_send_msg( nil_phone, NET_NIL_SEND, device_id, packet_get_id( packet ), sender, 0 )
98
    generic_send_msg( nil_phone, NET_NIL_SEND, device_id, packet_get_id( packet ), sender, 0 )
99
 
99
 
100
/** Returns the device packet dimensions for sending.
100
/** Returns the device packet dimensions for sending.
101
 *  @param nil_phone The network interface layer phone. Input parameter.
101
 *  @param[in] nil_phone The network interface layer phone.
102
 *  @param device_id The device identifier. Input parameter.
102
 *  @param[in] device_id The device identifier.
103
 *  @param addr_len The minimum reserved address length. Output parameter.
103
 *  @param[out] addr_len The minimum reserved address length.
104
 *  @param prefix The minimum reserved prefix size. Output parameter.
104
 *  @param[out] prefix The minimum reserved prefix size.
105
 *  @param content The maximum content size. Output parameter.
105
 *  @param[out] content The maximum content size.
106
 *  @param suffix The minimum reserved suffix size. Output parameter.
106
 *  @param[out] suffix The minimum reserved suffix size.
107
 *  @returns EOK on success.
107
 *  @returns EOK on success.
108
 *  @returns EBADMEM if either one of the parameters is NULL.
108
 *  @returns EBADMEM if either one of the parameters is NULL.
109
 *  @returns ENOENT if there is no such device.
109
 *  @returns ENOENT if there is no such device.
110
 *  @returns Other error codes as defined for the generic_packet_size_req() function.
110
 *  @returns Other error codes as defined for the generic_packet_size_req() function.
111
 */
111
 */
112
#define nil_packet_size_req( nil_phone, device_id, addr_len, prefix, content, suffix )  \
112
#define nil_packet_size_req( nil_phone, device_id, addr_len, prefix, content, suffix )  \
113
    generic_packet_size_req( nil_phone, NET_NIL_PACKET_SPACE, device_id, addr_len, prefix, content, suffix )
113
    generic_packet_size_req( nil_phone, NET_NIL_PACKET_SPACE, device_id, addr_len, prefix, content, suffix )
114
 
114
 
115
/** Registers new device or updates the MTU of an existing one.
115
/** Registers new device or updates the MTU of an existing one.
116
 *  @param nil_phone The network interface layer phone. Input parameter.
116
 *  @param[in] nil_phone The network interface layer phone.
117
 *  @param device_id The new device identifier. Input parameter.
117
 *  @param[in] device_id The new device identifier.
118
 *  @param mtu The device maximum transmission unit. Input parameter.
118
 *  @param[in] mtu The device maximum transmission unit.
119
 *  @param netif_service The device driver service. Input parameter.
119
 *  @param[in] netif_service The device driver service.
120
 *  @returns EOK on success.
120
 *  @returns EOK on success.
121
 *  @returns EEXIST if the device with the different service exists.
121
 *  @returns EEXIST if the device with the different service exists.
122
 *  @returns ENOMEM if there is not enough memory left.
122
 *  @returns ENOMEM if there is not enough memory left.
123
 *  @returns Other error codes as defined for the generic_device_req() function.
123
 *  @returns Other error codes as defined for the generic_device_req() function.
124
 */
124
 */
125
#define nil_device_req( nil_phone, device_id, mtu, netif_service )  \
125
#define nil_device_req( nil_phone, device_id, mtu, netif_service )  \
126
    generic_device_req( nil_phone, NET_NIL_DEVICE, device_id, mtu, netif_service )
126
    generic_device_req( nil_phone, NET_NIL_DEVICE, device_id, mtu, netif_service )
127
 
127
 
128
/** Notifies the network interface layer about the device state change.
128
/** Notifies the network interface layer about the device state change.
129
 *  @param nil_phone The network interface layer phone. Input parameter.
129
 *  @param[in] nil_phone The network interface layer phone.
130
 *  @param device_id The device identifier. Input parameter.
130
 *  @param[in] device_id The device identifier.
131
 *  @param state The new device state. Input parameter.
131
 *  @param[in] state The new device state.
132
 *  @returns EOK on success.
132
 *  @returns EOK on success.
133
 *  @returns Other error codes as defined for each specific module device state function.
133
 *  @returns Other error codes as defined for each specific module device state function.
134
 */
134
 */
135
int nil_device_state_msg( int nil_phone, device_id_t device_id, int state );
135
int nil_device_state_msg( int nil_phone, device_id_t device_id, int state );
136
 
136
 
137
/** Passes the packet queue to the network interface layer.
137
/** Passes the packet queue to the network interface layer.
138
 *  Processes and redistributes the received packet queue to the registered upper layers.
138
 *  Processes and redistributes the received packet queue to the registered upper layers.
139
 *  @param nil_phone The network interface layer phone. Input parameter.
139
 *  @param[in] nil_phone The network interface layer phone.
140
 *  @param device_id The source device identifier. Input parameter.
140
 *  @param[in] device_id The source device identifier.
141
 *  @param packet The received packet or the received packet queue. Input parameter.
141
 *  @param[in] packet The received packet or the received packet queue.
142
 *  @param target The target service. Ignored parameter.
142
 *  @param target The target service. Ignored parameter.
143
 *  @returns EOK on success.
143
 *  @returns EOK on success.
144
 *  @returns Other error codes as defined for each specific module received function.
144
 *  @returns Other error codes as defined for each specific module received function.
145
 */
145
 */
146
int nil_received_msg( int nil_phone, device_id_t device_id, packet_t packet, services_t target );
146
int nil_received_msg( int nil_phone, device_id_t device_id, packet_t packet, services_t target );
147
 
147
 
148
/** Creates bidirectional connection with the network interface layer module and registers the message receiver.
148
/** Creates bidirectional connection with the network interface layer module and registers the message receiver.
149
 *  @param service The network interface layer module service. Input parameter.
149
 *  @param[in] service The network interface layer module service.
150
 *  @param device_id The device identifier. Input parameter.
150
 *  @param[in] device_id The device identifier.
151
 *  @param me The requesting module service. Input parameter.
151
 *  @param[in] me The requesting module service.
152
 *  @param receiver The message receiver. Input parameter.
152
 *  @param[in] receiver The message receiver.
153
 *  @returns The phone of the needed service.
153
 *  @returns The phone of the needed service.
154
 *  @returns EOK on success.
154
 *  @returns EOK on success.
155
 *  @returns Other error codes as defined for the bind_service() function.
155
 *  @returns Other error codes as defined for the bind_service() function.
156
 */
156
 */
157
#define nil_bind_service( service, device_id, me, receiver )    \
157
#define nil_bind_service( service, device_id, me, receiver )    \