Changeset 00d7e1b in mainline for uspace/lib/c/include/net/device.h
- Timestamp:
- 2011-10-07T20:20:33Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 49bd793b
- Parents:
- e2c50e1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/net/device.h
re2c50e1 r00d7e1b 41 41 #include <adt/int_map.h> 42 42 #include <net/eth_phys.h> 43 #include <bool.h> 43 44 44 45 /** Ethernet address length. */ … … 51 52 #define ARGSMAC(__a) \ 52 53 (__a)[0], (__a)[1], (__a)[2], (__a)[3], (__a)[4], (__a)[5] 54 55 /* Compare MAC address with specific value */ 56 #define MAC_EQUALS_VALUE(__a, __a0, __a1, __a2, __a3, __a4, __a5) \ 57 ((__a)[0] == (__a0) && (__a)[1] == (__a1) && (__a)[2] == (__a2) \ 58 && (__a)[3] == (__a3) && (__a)[4] == (__a4) && (__a)[5] == (__a5)) 59 60 #define MAC_IS_ZERO(__x) \ 61 MAC_EQUALS_VALUE(__x, 0, 0, 0, 0, 0, 0) 53 62 54 63 /** Device identifier to generic type map declaration. */ … … 221 230 } nic_device_stats_t; 222 231 232 /** Errors corresponding to those in the nic_device_stats_t */ 233 typedef enum { 234 NIC_SEC_BUFFER_FULL, 235 NIC_SEC_ABORTED, 236 NIC_SEC_CARRIER_LOST, 237 NIC_SEC_FIFO_OVERRUN, 238 NIC_SEC_HEARTBEAT, 239 NIC_SEC_WINDOW_ERROR, 240 /* Error encountered during TX but with other type of error */ 241 NIC_SEC_OTHER 242 } nic_send_error_cause_t; 243 244 /** Errors corresponding to those in the nic_device_stats_t */ 245 typedef enum { 246 NIC_REC_BUFFER_FULL, 247 NIC_REC_LENGTH, 248 NIC_REC_BUFFER_OVERFLOW, 249 NIC_REC_CRC, 250 NIC_REC_FRAME_ALIGNMENT, 251 NIC_REC_FIFO_OVERRUN, 252 NIC_REC_MISSED, 253 /* Error encountered during RX but with other type of error */ 254 NIC_REC_OTHER 255 } nic_receive_error_cause_t; 256 223 257 /** 224 258 * Information about the NIC that never changes - name, vendor, model, … … 246 280 247 281 /** 282 * Type of the ethernet frame 283 */ 284 typedef enum nic_frame_type { 285 NIC_FRAME_UNICAST, 286 NIC_FRAME_MULTICAST, 287 NIC_FRAME_BROADCAST 288 } nic_frame_type_t; 289 290 /** 248 291 * Specifies which unicast frames is the NIC receiving. 249 292 */ … … 292 335 293 336 /** 337 * Structure passed as argument for virtue NIC_WV_MAGIC_PACKET. 338 */ 339 typedef struct nic_wv_magic_packet_data { 340 uint8_t password[6]; 341 } nic_wv_magic_packet_data_t; 342 343 /** 344 * Structure passed as argument for virtue NIC_WV_DIRECTED_IPV4 345 */ 346 typedef struct nic_wv_ipv4_data { 347 uint8_t address[4]; 348 } nic_wv_ipv4_data_t; 349 350 /** 351 * Structure passed as argument for virtue NIC_WV_DIRECTED_IPV6 352 */ 353 typedef struct nic_wv_ipv6_data { 354 uint8_t address[16]; 355 } nic_wv_ipv6_data_t; 356 357 /** 294 358 * WOL virtue types defining the interpretation of data passed to the virtue. 295 359 * Those tagged with S can have only single virtue active at one moment, those … … 376 440 NIC_POLL_SOFTWARE_PERIODIC 377 441 } nic_poll_mode_t; 442 443 /** 444 * Says if this virtue type is a multi-virtue (there can be multiple virtues of 445 * this type at once). 446 * 447 * @param type 448 * 449 * @return true or false 450 */ 451 static inline int nic_wv_is_multi(nic_wv_type_t type) { 452 switch (type) { 453 case NIC_WV_FULL_MATCH: 454 case NIC_WV_DESTINATION: 455 case NIC_WV_DIRECTED_IPV4: 456 case NIC_WV_DIRECTED_IPV6: 457 return true; 458 default: 459 return false; 460 } 461 } 378 462 379 463 static inline const char *nic_device_state_to_string(nic_device_state_t state)
Note:
See TracChangeset
for help on using the changeset viewer.