#include <stddef.h>
#include <assert.h>
Go to the source code of this file.
Data Structures | |
| struct | list_head |
Defines | |
| #define | LIST_HEAD_INIT(name) { &(name), &(name) } |
| #define | LIST_HEAD(name) struct list_head name = LIST_HEAD_INIT ( name ) |
| #define | INIT_LIST_HEAD(ptr) |
| #define | list_add(new, head) |
| #define | list_add_tail(new, head) |
| #define | list_del(entry) |
| #define | list_entry(ptr, type, member) container_of ( ptr, type, member ) |
| Get the containing struct for this entry. | |
| #define | list_for_each(pos, head) for ( pos = (head)->next; pos != (head); pos = pos->next ) |
| Iterate over a list. | |
| #define | list_for_each_entry(pos, head, member) |
| Iterate over entries in a list. | |
| #define | list_for_each_entry_safe(pos, tmp, head, member) |
| Iterate over entries in a list, safe against deletion of entries. | |
Functions | |
| FILE_LICENCE (GPL2_ONLY) | |
| static void | __list_add (struct list_head *new, struct list_head *prev, struct list_head *next) |
| static void | list_add (struct list_head *new, struct list_head *head) |
| Add a new entry to the head of a list. | |
| static void | list_add_tail (struct list_head *new, struct list_head *head) |
| Add a new entry to the tail of a list. | |
| static void | __list_del (struct list_head *prev, struct list_head *next) |
| static void | list_del (struct list_head *entry) |
| Delete an entry from a list. | |
| static int | list_empty (const struct list_head *head) |
| Test whether a list is empty. | |
This linked list handling code is based on the Linux kernel's list.h.
Definition in file list.h.
| #define INIT_LIST_HEAD | ( | ptr | ) |
Value:
do { \ (ptr)->next = (ptr); (ptr)->prev = (ptr); \ } while ( 0 )
Definition at line 37 of file list.h.
Referenced by alloc_ibdev(), alloc_netdev(), ath5k_desc_alloc(), ath5k_txq_setup(), eisabus_probe(), generic_settings_init(), ib_create_cq(), ib_create_mi(), ib_create_qp(), isabus_probe(), isapnpbus_probe(), mcabus_probe(), net80211_alloc(), net80211_probe_start(), open(), pcibus_probe(), probe_devices(), process_del(), process_init_stopped(), settings_init(), sis190_init_phy(), sis190_mii_probe(), t509bus_probe(), tcp_open(), undibus_probe(), and undipci_probe().
| #define list_add | ( | new, | |||
| head | ) |
Value:
do { \ assert ( (head)->next->prev == (head) ); \ assert ( (head)->prev->next == (head) ); \ list_add ( (new), (head) ); \ } while ( 0 )
Definition at line 68 of file list.h.
Referenced by add_ipv4_miniroute(), add_ipv6_miniroute(), alloc_memblock(), aoe_attach(), eisabus_probe(), generic_settings_store(), ib_create_conn(), ib_create_cq(), ib_create_madx(), ib_create_qp(), ib_mcast_attach(), ib_open(), ipv4_reassemble(), isabus_probe(), isapnpbus_probe(), mcabus_probe(), netdev_open(), open(), pcibus_probe(), probe_devices(), register_int13_drive(), sis190_mii_probe(), start_timer(), t509bus_probe(), tcp_open(), udp_open_common(), undibus_probe(), undipci_probe(), and undirom_probe().
| #define list_add_tail | ( | new, | |||
| head | ) |
Value:
do { \ assert ( (head)->next->prev == (head) ); \ assert ( (head)->prev->next == (head) ); \ list_add_tail ( (new), (head) ); \ } while ( 0 )
Definition at line 87 of file list.h.
Referenced by add_ipv4_miniroute(), add_ipv6_miniroute(), ath5k_desc_alloc(), ath5k_handle_rx(), ath5k_tx(), ath5k_tx_processq(), ath5k_txbuf_setup(), ath5k_txq_drainq(), free_memblock(), net80211_handle_mgmt(), net80211_probe_step(), net80211_register(), netdev_rx(), netdev_tx(), posix_file_xfer_deliver_iob(), process_add(), register_ibdev(), register_image(), register_netdev(), register_settings(), reprioritise_settings(), step(), tcp_xfer_deliver_iob(), and wpa_start().
| #define list_del | ( | entry | ) |
Value:
do { \ assert ( (entry)->prev != NULL ); \ assert ( (entry)->next != NULL ); \ assert ( (entry)->next->prev == (entry) ); \ assert ( (entry)->prev->next == (entry) ); \ list_del ( (entry) ); \ } while ( 0 )
Definition at line 117 of file list.h.
Referenced by alloc_memblock(), aoe_detach(), ath5k_handle_rx(), ath5k_tx(), ath5k_tx_processq(), ath5k_txq_drainq(), close(), del_ipv4_miniroute(), del_ipv6_miniroute(), eisabus_probe(), eisabus_remove(), free_memblock(), generic_settings_clear(), generic_settings_store(), ib_close(), ib_create_cq(), ib_create_qp(), ib_destroy_conn(), ib_destroy_cq(), ib_destroy_madx(), ib_destroy_qp(), ib_mcast_attach(), ib_mcast_detach(), isabus_probe(), isabus_remove(), isapnpbus_probe(), isapnpbus_remove(), mcabus_probe(), mcabus_remove(), net80211_free_wlanlist(), net80211_mgmt_dequeue(), net80211_probe_finish_best(), net80211_unregister(), netdev_close(), netdev_rx_dequeue(), netdev_tx_complete_err(), pcibus_probe(), pcibus_remove(), posix_file_free(), probe_devices(), process_del(), read_user(), register_ibdev(), remove_devices(), reprioritise_settings(), step(), stop_timer(), t509bus_probe(), t509bus_remove(), tcp_close(), tcp_process_queue(), timer_expired(), udp_close(), undibus_probe(), undibus_remove(), undipci_probe(), undipci_remove(), unregister_ibdev(), unregister_image(), unregister_int13_drive(), unregister_netdev(), unregister_settings(), and wpa_stop().
| #define list_entry | ( | ptr, | |||
| type, | |||||
| member | ) | container_of ( ptr, type, member ) |
Get the containing struct for this entry.
| ptr | The struct list_head pointer | |
| type | The type of the struct this is embedded in | |
| member | The name of the list_struct within the struct |
Definition at line 141 of file list.h.
Referenced by ath5k_handle_rx(), ath5k_rx_start(), ath5k_tx(), and sis190_default_phy().
| #define list_for_each | ( | pos, | |||
| head | ) | for ( pos = (head)->next; pos != (head); pos = pos->next ) |
| #define list_for_each_entry | ( | pos, | |||
| head, | |||||
| member | ) |
Value:
for ( pos = list_entry ( (head)->next, typeof ( *pos ), member ); \ &pos->member != (head); \ pos = list_entry ( pos->member.next, typeof ( *pos ), member ) )
| pos | The type * to use as a loop counter | |
| head | The head for your list | |
| member | The name of the list_struct within the struct |
Definition at line 160 of file list.h.
Referenced by alloc_memblock(), aoe_rx(), ath5k_desc_free(), ath5k_rx_start(), del_ipv6_address(), eapol_key_rx(), efi_snp_poll(), fetch_setting(), find_child_settings(), find_generic_setting(), find_image(), find_netdev(), find_netdev_by_location(), free_memblock(), ib_cm_connect_rep(), ib_find_qp_mgid(), ib_find_qp_qpn(), ib_find_wq(), ib_mcast_detach(), ib_mi_handle(), ib_poll_cq(), ib_poll_eq(), int13(), int13_set_num_drives(), ipv4_arp_check(), ipv4_reassemble(), ipv4_route(), ipv6_tx(), iwlist(), last_opened_ibdev(), last_opened_netdev(), linda_poll_cq(), net80211_check_settings_update(), net80211_get(), net80211_mgmt_dequeue(), net80211_probe_finish_best(), net80211_probe_step(), net_step(), netdev_rx_dequeue(), netdev_tx_complete_next_err(), posix_fd_to_file(), read_user(), reprioritise_settings(), route(), sis190_default_phy(), sis190_get_mac_addr_from_apc(), step(), tcp_bind(), tcp_demux(), udp_bind(), udp_demux(), and undirom_find_pci().
| #define list_for_each_entry_safe | ( | pos, | |||
| tmp, | |||||
| head, | |||||
| member | ) |
Value:
for ( pos = list_entry ( (head)->next, typeof ( *pos ), member ), \ tmp = list_entry ( pos->member.next, typeof ( *tmp ), member ); \ &pos->member != (head); \ pos = tmp, \ tmp = list_entry ( tmp->member.next, typeof ( *tmp ), member ) )
| pos | The type * to use as a loop counter | |
| tmp | Another type * to use for temporary storage | |
| head | The head for your list | |
| member | The name of the list_struct within the struct |
Definition at line 173 of file list.h.
Referenced by ath5k_tx_processq(), ath5k_txq_drainq(), eisabus_remove(), generic_settings_clear(), ib_destroy_mi(), imgfree_exec(), ipv4_create_routes(), isabus_remove(), isapnpbus_remove(), mcabus_remove(), net80211_free_wlanlist(), pcibus_remove(), posix_file_free(), remove_devices(), retry_step(), sis190_free_phy(), t509bus_remove(), tcp_close(), tcp_process_queue(), and wpa_stop().
| FILE_LICENCE | ( | GPL2_ONLY | ) |
| static void __list_add | ( | struct list_head * | new, | |
| struct list_head * | prev, | |||
| struct list_head * | next | |||
| ) | [inline, static] |
Definition at line 47 of file list.h.
References list_head::next, and list_head::prev.
Referenced by list_add(), and list_add_tail().
00049 { 00050 next->prev = new; 00051 new->next = next; 00052 new->prev = prev; 00053 prev->next = new; 00054 }
Add a new entry to the head of a list.
| new | New entry to be added | |
| head | List head to add it after |
Definition at line 65 of file list.h.
References __list_add(), and list_head::next.
00065 { 00066 __list_add ( new, head, head->next ); 00067 }
Add a new entry to the tail of a list.
| new | New entry to be added | |
| head | List head to add it before |
Definition at line 83 of file list.h.
References __list_add(), and list_head::prev.
00084 { 00085 __list_add ( new, head->prev, head ); 00086 }
Definition at line 100 of file list.h.
References list_head::next, and list_head::prev.
Referenced by list_del().
| static void list_del | ( | struct list_head * | entry | ) | [inline, static] |
Delete an entry from a list.
| entry | Element to delete from the list |
Definition at line 114 of file list.h.
References __list_del(), list_head::next, and list_head::prev.
00114 { 00115 __list_del ( entry->prev, entry->next ); 00116 }
| static int list_empty | ( | const struct list_head * | head | ) | [inline, static] |
Test whether a list is empty.
| head | List to test. |
Definition at line 130 of file list.h.
References list_head::next.
Referenced by ath5k_handle_rx(), ath5k_tx(), ath5k_tx_processq(), efi_snp_get_status(), generic_settings_clear(), have_images(), have_netdevs(), ib_destroy_cq(), ib_destroy_qp(), iwlist(), net80211_probe_step(), netdev_tx_flush(), open(), process_add(), process_del(), pxenv_undi_isr(), read_user(), register_int13_drive(), select(), sis190_mii_probe(), tcp_close(), tcp_rx_ack(), tcp_xfer_window(), and unregister_int13_drive().
00130 { 00131 return head->next == head; 00132 }
1.5.7.1