Changes in uspace/lib/nic/include/nic.h [00d7e1b:77a69ea] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/nic/include/nic.h
r00d7e1b r77a69ea 42 42 #include <ddf/driver.h> 43 43 #include <device/hw_res_parsed.h> 44 #include <net/packet.h>45 44 #include <ops/nic.h> 45 46 #define DEVICE_CATEGORY_NIC "nic" 46 47 47 48 struct nic; … … 61 62 62 63 /** 63 * Simple structure for sending the allocated frames (packets) in a list.64 * Simple structure for sending lists of frames. 64 65 */ 65 66 typedef struct { 66 67 link_t link; 67 packet_t *packet; 68 void *data; 69 size_t size; 68 70 } nic_frame_t; 69 71 … … 71 73 72 74 /** 73 * Handler for writing packetdata to the NIC device.74 * The function is responsible for releasing the packet.75 * Handler for writing frame data to the NIC device. 76 * The function is responsible for releasing the frame. 75 77 * It does not return anything, if some error is detected the function just 76 78 * silently fails (logging on debug level is suggested). 77 79 * 78 80 * @param nic_data 79 * @param packet Pointer to the packet to be sent 80 */ 81 typedef void (*write_packet_handler)(nic_t *, packet_t *); 81 * @param data Pointer to frame data 82 * @param size Size of frame data in bytes 83 */ 84 typedef void (*send_frame_handler)(nic_t *, void *, size_t); 82 85 /** 83 86 * The handler for transitions between driver states. … … 157 160 * @return ENOTSUP If this filter cannot work on this NIC (e.g. the NIC 158 161 * cannot run in promiscuous node or the limit of WOL 159 * packets' specifications was reached).162 * frames' specifications was reached). 160 163 * @return ELIMIT If this filter must implemented in HW but currently the 161 164 * limit of these HW filters was reached. … … 203 206 /* Functions called in add_device */ 204 207 extern int nic_connect_to_services(nic_t *); 205 extern int nic_register_as_ddf_fun(nic_t *, ddf_dev_ops_t *);206 208 extern int nic_get_resources(nic_t *, hw_res_list_parsed_t *); 207 209 extern void nic_set_specific(nic_t *, void *); 208 extern void nic_set_ write_packet_handler(nic_t *, write_packet_handler);210 extern void nic_set_send_frame_handler(nic_t *, send_frame_handler); 209 211 extern void nic_set_state_change_handlers(nic_t *, 210 212 state_change_handler, state_change_handler, state_change_handler); … … 218 220 poll_mode_change_handler, poll_request_handler); 219 221 220 /* Functions called in device_added */221 extern int nic_ready(nic_t *);222 223 222 /* General driver functions */ 224 223 extern ddf_dev_t *nic_get_ddf_dev(nic_t *); 225 224 extern ddf_fun_t *nic_get_ddf_fun(nic_t *); 225 extern void nic_set_ddf_fun(nic_t *, ddf_fun_t *); 226 226 extern nic_t *nic_get_from_ddf_dev(ddf_dev_t *); 227 227 extern nic_t *nic_get_from_ddf_fun(ddf_fun_t *); … … 232 232 extern int nic_report_poll_mode(nic_t *, nic_poll_mode_t, struct timeval *); 233 233 extern void nic_query_address(nic_t *, nic_address_t *); 234 extern void nic_received_packet(nic_t *, packet_t *); 235 extern void nic_received_noneth_packet(nic_t *, packet_t *); 234 extern void nic_received_noneth_frame(nic_t *, void *, size_t); 236 235 extern void nic_received_frame(nic_t *, nic_frame_t *); 237 236 extern void nic_received_frame_list(nic_t *, nic_frame_list_t *); … … 247 246 extern void nic_report_collisions(nic_t *, unsigned); 248 247 249 /* Packet / frame / frame list allocation and deallocation */ 250 extern packet_t *nic_alloc_packet(nic_t *, size_t); 251 extern void nic_release_packet(nic_t *, packet_t *); 248 /* Frame / frame list allocation and deallocation */ 252 249 extern nic_frame_t *nic_alloc_frame(nic_t *, size_t); 253 250 extern nic_frame_list_t *nic_alloc_frame_list(void); … … 274 271 extern void nic_sw_period_stop(nic_t *); 275 272 276 /* Packet DMA lock */277 extern void * nic_dma_lock_packet(packet_t * packet);278 extern void nic_dma_unlock_packet(packet_t * packet);279 280 273 #endif // __NIC_H__ 281 274
Note:
See TracChangeset
for help on using the changeset viewer.