Linux 網絡卡驅動學習(三)(net_device 等資料結構)
【摘要】前文對網路驅動例子進行一個簡單的梳理總結,本文貼出 net_device 的資料結構以及一些驅動中常用的資料結構。
1、網路裝置驅動結構
1)、網路協議介面層向網路層協議提供提供統一的資料包收發介面,不論上層協議為ARP還是IP,都通過dev_queue_xmit()函式傳送資料,並通過netif_rx()函式接受資料。這一層的存在使得上層協議獨立於具體的裝置。
2)、網路裝置介面層向協議介面層提供統一的用於描述具體網路裝置屬性和操作的結構體net_device,該結構體是裝置驅動功能層中各函式的容器。實際上,網路裝置介面層從巨集觀上規劃了具體操作硬體的裝置驅動功能層的結構。
3)、裝置驅動功能層各函式是網路裝置介面層net_device資料結構的具體成員,是驅使網路裝置硬體完成相應動作的程式,他通過hard_start_xmit()函式啟動傳送操作,並通過網路裝置上的中斷觸發接受操作。
2、網絡卡驅動中重要的資料結構
struct softnet_data { int throttle; int cng_level; int avg_blog; struct sk_buff_head input_pkt_queue; struct list_head poll_list; struct net_device *output_queue; struct sk_buff *completion_queue; struct net_device backlog_dev; /* Sorry. 8) */ }; struct packet_type { unsigned short type; /* This is really htons(ether_type). */ struct net_device *dev; /* NULL is wildcarded here */ int (*func) (struct sk_buff *, struct net_device *, struct packet_type *); void *af_packet_priv; struct list_head list; }; struct netif_rx_stats { unsigned total; unsigned dropped; unsigned time_squeeze; unsigned throttled; unsigned fastroute_hit; unsigned fastroute_success; unsigned fastroute_defer; unsigned fastroute_deferred_out; unsigned fastroute_latency_reduction; unsigned cpu_collision; }; struct net_device_stats { unsigned long rx_packets; /* total packets received */ unsigned long tx_packets; /* total packets transmitted */ unsigned long rx_bytes; /* total bytes received */ unsigned long tx_bytes; /* total bytes transmitted */ unsigned long rx_errors; /* bad packets received */ unsigned long tx_errors; /* packet transmit problems */ unsigned long rx_dropped; /* no space in linux buffers */ unsigned long tx_dropped; /* no space available in linux */ unsigned long multicast; /* multicast packets received */ unsigned long collisions; /* detailed rx_errors: */ unsigned long rx_length_errors; unsigned long rx_over_errors; /* receiver ring buff overflow */ unsigned long rx_crc_errors; /* recved pkt with crc error */ unsigned long rx_frame_errors; /* recv'd frame alignment error */ unsigned long rx_fifo_errors; /* recv'r fifo overrun */ unsigned long rx_missed_errors; /* receiver missed packet */ /* detailed tx_errors */ unsigned long tx_aborted_errors; unsigned long tx_carrier_errors; unsigned long tx_fifo_errors; unsigned long tx_heartbeat_errors; unsigned long tx_window_errors; /* for cslip etc */ unsigned long rx_compressed; unsigned long tx_compressed; }; /* Media selection options. */ enum { IF_PORT_UNKNOWN = 0, IF_PORT_10BASE2, IF_PORT_10BASET, IF_PORT_AUI, IF_PORT_100BASET, IF_PORT_100BASETX, IF_PORT_100BASEFX }; struct net_device { /* * This is the first field of the "visible" part of this structure * (i.e. as seen by users in the "Space.c" file). It is the name * the interface. */ char name[IFNAMSIZ]; //eth0 eth1 ... ethn /* * I/O specific fields * FIXME: Merge these and struct ifmap into one */ unsigned long mem_end; /* shared mem end */ unsigned long mem_start; /* shared mem start */ unsigned long base_addr; /* device I/O address */ //網路介面的I/O基地址,由驅動在裝置探測時賦值 ifconfig可以顯示或 修改當前值,該欄位可以在系統啟動時在核心命令列中顯式賦值,或者 在模組載入時賦值。這個成員一般不被引用 unsigned int irq; /* device IRQ number */ //網路裝置使用的中斷號。irq值常常在網路裝置啟動時載入設定, 並且在後來由ifconfig打印出來。 /* * Some hardware also needs these fields, but they are not * part of the usual set specified in Space.c. */ unsigned char if_port; /* Selectable AUI, TP,..*/ //多埠裝置中使用的埠。該成員在同軸線(IF_PORT_10BASE2)和 //雙絞線(IF_PORT_100BASET)乙太網連線時使用 unsigned char dma; /* DMA channel */ //在某些外設匯流排時有意義,如ISA匯流排。它不在裝置驅動自身以外使用 unsigned long state; //網路裝置和網路介面卡的狀態資訊 struct net_device *next; //下一個struct net_device Linux中所有網路裝置都以dev_base指標開頭的單線行連結串列管理 /* The device initialization function. Called only once. */ int (*init)(struct net_device *dev); 用來搜尋並初始化網路裝置。該方法負責尋找並初始化當前型別的網路介面卡。首選必須建立net_device結構並將網路裝置和網路驅動程式的資料(驅動相關的)填充進去。其次,register_netdevice()註冊網路裝置 /* ------- Fields preinitialized in Space.c finish here ------- */ struct net_device *next_sched; /* Interface index. Unique device identifier */ int ifindex; int iflink; struct net_device_stats* (*get_stats)(struct net_device *dev); 應用程式需要獲取網路介面的統計資訊時會呼叫這個方法。例如,在執行ifconfig或netstat -i時,會呼叫該方法 struct iw_statistics* (*get_wireless_stats)(struct net_device *dev); /* List of functions to handle Wireless Extensions (instead of ioctl). * See <net/iw_handler.h> for details. Jean II */ const struct iw_handler_def * wireless_handlers; /* Instance data managed by the core of Wireless Extensions. */ struct iw_public_data * wireless_data; struct ethtool_ops *ethtool_ops; /* * This marks the end of the "visible" part of the structure. All * fields hereafter are internal to the system, and may change at * will (read: may be cleaned up at will). */ /* These may be needed for future network-power-down code. */ unsigned long trans_start; /* Time (in jiffies) of last Tx */ unsigned long last_rx; /* Time of last Rx */ unsigned short flags; /* interface flags (a la BSD) */ unsigned short gflags; unsigned short priv_flags; /* Like 'flags' but invisible to userspace. */ unsigned short unused_alignment_fixer; /* Because we need priv_flags, * and we want to be 32-bit aligned. */ unsigned mtu; /* interface MTU value */ //最大傳輸單元。它指定鏈路層每幀有效載荷最大長度。網路層各協議必須 考慮該值,以確保不會向網路介面卡傳送多餘的位元組,乙太網1500,通 過ifconfig命令可改變 unsigned short type; /* interface hardware type */ //指定了網路介面卡的硬體型別。這個成員由ARP用來決定網路介面卡 支援的硬體地址。對乙太網介面一般由ether_setup()函式設定其值為 ARPHRD_ETHER unsigned short hard_header_len; /* hardware hdr length */ //指定鏈路層資料幀包頭長度。對於乙太網介面為14 void *priv; /* pointer to private data */ struct net_device *master; /* Pointer to master device of a group, * which this device is member of. */ /* Interface address info. */ unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ //廣播地址 /*乙太網地址長度是6個位元組(我們指的是介面板的硬體ID),廣播地址由6個0xff位元組組成。這些欄位一般由ether_setup()函式設定。驅動程式必須以特定於裝置的方式從介面板讀出,並複製到dev_addr結構。網路裝置的硬體地址用來產生正確的乙太網頭*/ unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address */ //存放裝置硬體地址 unsigned char addr_len; /* hardware address length */ //硬體(MAC)地址長度 struct dev_mc_list *mc_list; /* Multicast mac addresses */ /*指向具有多播的第二層地址的線性表。當網路介面卡收集到具有包含在dev_mc_list中目標地址後,網路介面卡必須將包傳遞給更高層。驅動程式中方法set_multicast_list用來將該列表中的地址傳遞給網路介面卡。該網路介面卡的硬體過濾器(如果有)負責只將與該計算機有關的包傳遞給核心 */ int mc_count; /* Number of installed mcasts */ //dev_mc_list包含的地址數量 int promiscuity; int allmulti; /*下面兩個變數用來發現介面卡在傳送包時遇到的問題。 int watchdog_timeo; struct timer_list watchdog_timer; /*在網路裝置啟動時開啟,每經過watch_timeo時間後立即被呼叫。處理程式dev_watchdog()檢查從上一次(儲存在stans_start中)包傳輸後是否經過watch_timeo單位長度的時間。如果是,那麼上一個包的傳輸中出現問題,必須檢查網路介面卡。要檢查網路介面卡,需要呼叫驅動函式tx_timeout()。如果從上次傳輸開始還沒有經過足夠長的時間,那麼除了watchdog計時器啟動之外沒有發生其他網路事件*/ /* Protocol specific pointers */ /*指向網路介面卡的第三層協議的資訊。如果網路裝置被設定為Internet協議,那麼ip_ptr指向in_device型別的結構,它管理有關的IP例項的資訊和配置引數。例如in_device結構管理包含網路裝置IP地址列表,包含多播組活動IP列表和ARP協議引數等*/ void *atalk_ptr; /* AppleTalk link */ void *ip_ptr; /* IPv4 specific data */ void *dn_ptr; /* DECnet specific data */ void *ip6_ptr; /* IPv6 specific data */ void *ec_ptr; /* Econet specific data */ void *ax25_ptr; /* AX.25 specific data */ struct list_head poll_list; /* Link to poll list */ int quota; int weight; struct Qdisc *qdisc; struct Qdisc *qdisc_sleeping; struct Qdisc *qdisc_ingress; struct list_head qdisc_list; unsigned long tx_queue_len; /* Max frames per queue allowed */ //該欄位表示指定了網路裝置傳送佇列中可以排列的最大幀數 這個值有ether_setup()設定為100.不要將tx_queue_len 與網路介面卡的緩衝區想混淆。通常網路介面卡有額外的環形 緩衝區,大小為16或32個包大小 /* ingress path synchronizer */ spinlock_t ingress_lock; /* hard_start_xmit synchronizer */ spinlock_t xmit_lock; /* cpu id of processor entered to hard_start_xmit or -1, if nobody entered there. */ int xmit_lock_owner; /* device queue lock */ spinlock_t queue_lock; /* Number of references to this device */ atomic_t refcnt; /* delayed register/unregister */ struct list_head todo_list; /* device name hash chain */ struct hlist_node name_hlist; /* device index hash chain */ struct hlist_node index_hlist; /* register/unregister state machine */ enum { NETREG_UNINITIALIZED=0, NETREG_REGISTERING, /* called register_netdevice */ NETREG_REGISTERED, /* completed register todo */ NETREG_UNREGISTERING, /* called unregister_netdevice */ NETREG_UNREGISTERED, /* completed unregister todo */ NETREG_RELEASED, /* called free_netdev */ } reg_state; /* Net device features */ int features; #define NETIF_F_SG 1 /* Scatter/gather IO. */ #define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */ #define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */ #define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */ #define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */ #define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */ #define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */ #define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */ #define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ #define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ #define NETIF_F_LLTX 4096 /* LockLess TX */ /* Called after device is detached from network. */ void (*uninit)(struct net_device *dev); 用來登出網路裝置,該方法用來執行驅動程式相關的函式,這些函式在刪除網路裝置時也是必須的。目前沒有驅動程式使用該方法 /* Called after last user reference disappears. */ void (*destructor)(struct net_device *dev); /* Pointers to interface service routines. */ int (*open)(struct net_device *dev); 開啟一個已經命名的網路裝置。可以使用ifconfig命令啟用網路裝置,在啟用過程中,open方法應當註冊它需要的系統資源(I/O口,IRQ,DMA,等等),以及進行其他的網路裝置要求 int (*stop)(struct net_device *dev); 停止網路介面卡的活動並釋放相關資源,此後網路裝置不能活動 int (*hard_start_xmit) (struct sk_buff *skb, struct net_device *dev); 在網路裝置上傳送資料包的方法。完整的報文(協議頭和所有其他資料)包含在一個socket緩衝區(sk_buff)結構中。資料包如果成功傳送到網路介面卡該函式返回0,否則返回1 #define HAVE_NETDEV_POLL int (*poll) (struct net_device *dev, int *quota); int (*hard_header) (struct sk_buff *skb, struct net_device *dev, unsigned short type, void *daddr, void *saddr, unsigned len); 用先前提取到的源和目的硬體地址來建立硬體頭的函式(在hard_start_xmit 前呼叫)。它的工作是將傳給它的引數資訊組織成一個合適的特定於裝置的硬體頭 int (*rebuild_header)(struct sk_buff *skb); 用來在ARP解析完成後、報文傳送前,重建硬體頭的函式 #define HAVE_MULTICAST void (*set_multicast_list)(struct net_device *dev); 將多播MAC地址列表傳遞給網路介面卡,介面卡就可以根據這些地址接收包 #define HAVE_SET_MAC_ADDR int (*set_mac_address)(struct net_device *dev, void *addr); 改變網路裝置的硬體地址(MAC地址) #define HAVE_PRIVATE_IOCTL int (*do_ioctl)(struct net_device *dev, struct ifreq *ifr, int cmd); #define HAVE_SET_CONFIG int (*set_config)(struct net_device *dev, struct ifmap *map); #define HAVE_HEADER_CACHE int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh); void (*header_cache_update)(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr); 在響應一個變化中,更新hh_cache結構中的目的地址方法 #define HAVE_CHANGE_MTU int (*change_mtu)(struct net_device *dev, int new_mtu); 改變網路裝置最大傳輸單元(MTU)函式 #define HAVE_TX_TIMEOUT void (*tx_timeout) (struct net_device *dev); 網路驅動程式程式碼沒有在一個合理的時間內將一個報文傳送完成時會呼叫該方法,報文沒有被及時傳送的原因可能是丟失一箇中斷或某個介面被鎖。此時該函式處理這個問題並恢復報文傳送 void (*vlan_rx_register)(struct net_device *dev, struct vlan_group *grp); void (*vlan_rx_add_vid)(struct net_device *dev, unsigned short vid); void (*vlan_rx_kill_vid)(struct net_device *dev, unsigned short vid); int (*hard_header_parse)(struct sk_buff *skb, unsigned char *haddr); 該方法完成的工作包括從skb中的報文中抽取源地址,複製到haddr的緩衝區中。函式的返回值是地址的長度資訊 int (*neigh_setup)(struct net_device *dev, struct neigh_parms *); int (*accept_fastpath)(struct net_device *, struct dst_entry*); #ifdef CONFIG_NETPOLL int netpoll_rx; #endif #ifdef CONFIG_NET_POLL_CONTROLLER void (*poll_controller)(struct net_device *dev); #endif /* bridge stuff */ struct net_bridge_port *br_port; #ifdef CONFIG_NET_DIVERT /* this will get initialized at each interface type init routine */ struct divert_blk *divert; #endif /* CONFIG_NET_DIVERT */ /* class/net/name entry */ struct class_device class_dev; /* how much padding had been added by alloc_netdev() */ int padded; }; struct netdev_boot_setup { char name[IFNAMSIZ]; struct ifmap map; }; struct hh_cache { struct hh_cache *hh_next; /* Next entry */ atomic_t hh_refcnt; /* number of users */ unsigned short hh_type; /* protocol identifier, f.e ETH_P_IP * NOTE: For VLANs, this will be the * encapuslated type. --BLG */ int hh_len; /* length of header */ int (*hh_output)(struct sk_buff *skb); rwlock_t hh_lock; /* cached hardware header; allow for machine alignment needs. */ #define HH_DATA_MOD 16 #define HH_DATA_OFF(__len) \ (HH_DATA_MOD - ((__len) & (HH_DATA_MOD - 1))) #define HH_DATA_ALIGN(__len) \ (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1)) unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; }; struct dev_mc_list { struct dev_mc_list *next; __u8 dmi_addr[MAX_ADDR_LEN]; unsigned char dmi_addrlen; int dmi_users; int dmi_gusers; }; struct sk_buff_head { /* These two members must be first. */ struct sk_buff *next; struct sk_buff *prev; __u32 qlen; spinlock_t lock; }; struct sk_buff; /* To allow 64K frame to be packed as single skb without frag_list */ #define MAX_SKB_FRAGS (65536/PAGE_SIZE + 2) typedef struct skb_frag_struct skb_frag_t; struct skb_frag_struct { struct page *page; __u16 page_offset; __u16 size; }; struct sk_buff { /* These two members must be first. */ struct sk_buff *next; struct sk_buff *prev; //雙向連結串列指標 struct sk_buff_head *list; 指向套接字快取在佇列中的當前位置 struct sock *sk; 指向建立報文的socket struct timeval stamp; 報文到達Linux系統的時間 struct net_device *dev; 表明套接字快取當前操作所在的網路裝置。網路路由器被確定下來後,dev就指向報文離開計算機時經過的網路介面卡。知道報文的輸出介面卡已知之前,dev都指向輸入介面卡 struct net_device *input_dev; struct net_device *real_dev; union { struct tcphdr *th; struct udphdr *uh; struct icmphdr *icmph; struct igmphdr *igmph; struct iphdr *ipiph; struct ipv6hdr *ipv6h; unsigned char *raw; } h; 傳輸層報文幀頭的指標 union { struct iphdr *iph; struct ipv6hdr *ipv6h; struct arphdr *arph; unsigned char *raw; } nh; 網路層報文幀頭的指標 union { unsigned char *raw; } mac; MAC層報文幀頭的指標 struct dst_entry *dst; 指向路由快取記憶體中的一條記錄,它包含著有關報文進一步前進的路由資訊 struct sec_path *sp; /* * This is the control buffer. It is free to use for every * layer. Please put your private variables there. If you * want to keep them across layers you have to do a skb_clone() * first. This is owned by whoever has the skb queued ATM. */ char cb[40]; unsigned int len, 指明套接字快取所代表的報文長度,這裡只考慮核心可訪問的資料。在乙太網報文中兩個MAC地址和型別/長度域被考慮其中。其他的域(報頭、連結和檢驗)以後再在網路介面卡中進行新增 data_len, mac_len, csum; unsigned char local_df, cloned, pkt_type, 報文的型別 ip_summed; __u32 priority; unsigned short protocol, security; void (*destructor)(struct sk_buff *skb); #ifdef CONFIG_NETFILTER unsigned long nfmark; __u32 nfcache; __u32 nfctinfo; struct nf_conntrack *nfct; #ifdef CONFIG_NETFILTER_DEBUG unsigned int nf_debug; #endif #ifdef CONFIG_BRIDGE_NETFILTER struct nf_bridge_info *nf_bridge; #endif #endif /* CONFIG_NETFILTER */ #if defined(CONFIG_HIPPI) union { __u32 ifield; } private; #endif #ifdef CONFIG_NET_SCHED __u32 tc_index; /* traffic control index */ #ifdef CONFIG_NET_CLS_ACT __u32 tc_verd; /* traffic control verdict */ __u32 tc_classid; /* traffic control classid */ #endif #endif /* These elements must be at the end, see alloc_skb() for details. */ unsigned int truesize; atomic_t users; unsigned char *head, *data, *tail, *end; }; struct skb_shared_info { atomic_t dataref; unsigned int nr_frags; unsigned short tso_size; unsigned short tso_segs; struct sk_buff *frag_list; skb_frag_t frags[MAX_SKB_FRAGS]; }; struct skb_iter { /* Iteration functions set these */ unsigned char *data; unsigned int len; /* Private to iteration */ unsigned int nextfrag; struct sk_buff *fraglist; }; #ifdef CONFIG_NETFILTER struct nf_conntrack { atomic_t use; void (*destroy)(struct nf_conntrack *); }; #ifdef CONFIG_BRIDGE_NETFILTER struct nf_bridge_info { atomic_t use; struct net_device *physindev; struct net_device *physoutdev; #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) struct net_device *netoutdev; #endif unsigned int mask; unsigned long data[32 / sizeof(unsigned long)]; };
相關推薦
Linux 網絡卡驅動學習(三)(net_device 等資料結構)
【摘要】前文對網路驅動例子進行一個簡單的梳理總結,本文貼出 net_device 的資料結構以及一些驅動中常用的資料結構。 1、網路裝置驅動結構 1)、網路協議介面層向網路層協議提供提供統一的資料包收發介面,不論上層協議為ARP還是IP,都通過dev_queue_xmi
Linux 網絡卡驅動學習(二)(網路驅動介面小結)
【摘要】前文我們分析了一個虛擬硬體的網路驅動例子,從中我們看到了網路裝置的一些介面,其實網路裝置驅動和塊裝置驅動的功能比較類似,都是傳送和接收資料包(資料請求)。當然它們實際是有很多不同的。 1、引言 首先塊裝置在/dev目錄下有裝置節點,而網路裝置沒有
嵌入式Linux——網絡卡驅動(1):網絡卡驅動框架介紹
宣告:文字是看完韋東山老師的視訊和看了一些文章後,所寫的總結。我會盡力將自己所瞭解的知識寫出來,但由於自己感覺並沒有學的很好,所以文中可能有錯的地方敬請指出,謝謝。 在介紹本文之前,我想先對前面的知識做一下總結,我們知道Linux系統的裝置分為字元裝置(ch
學習筆記 --- LINUX網絡卡驅動框架分析
網絡卡的驅動很簡單,就是填充net_device結構體,其應用層到網路協議層核心已經完成了,我們的工作就是填寫這個net_device,然後註冊就可以了。 修正一下:上面第三步應該是:register_netdev 下面程式碼實現一個虛擬網絡卡,這裡沒有實際的網絡卡,只是
Linux 網絡卡驅動sk_buff核心原始碼隨筆
這幾天在除錯有關網絡卡驅動的東西,有很多地方不清楚。而且網絡卡驅動主要有兩個很重要的結構體:struct net_device 和struct sk_buff。 驅動都是圍繞這兩個東西進行操作的,為了搞清楚該如何按協議棧處理資料包,週末閒來無事就看看核
linux網絡卡驅動
1. 匯流排、裝置和驅動 1.1 簡單介紹 Linux裝置模型中三個很重要的概念就是匯流排、裝置和驅動,即bus,device和driver。它們分別對應的資料結構分別為struct bus_type,struct device和struct de
linux網絡卡驅動分析之probe函式
從上面結果可以看出,該裝置使用了6個BAR中的2個BAR,即BAR0和BAR1,該裝置申請了兩塊IO記憶體,BAR0的範圍為:fea00000-fea1ffff,大小為128KB,用來對映裝置暫存器,BAR1的範圍為fea20000-fea23fff,大小為32KB,用來對映flash。裝置需要
網絡卡驅動學習之netlink
Netlink is a socket family that for IPC between the kernel and user space processes, as well as between user processes (like e.g., UNIX sockets) or a mixtu
tiny4412學習(三)之移植linux-4.x驅動(1)支援網絡卡驅動
一、思路 上一節我們通過DNW將核心、檔案系統、裝置樹檔案燒入到記憶體中,並使用bootm啟動核心:bootm0x40600000 0x41000000 0x42000000。因為此時核心並沒有S
l(轉)Linux DM9000網絡卡驅動程式完全分析
[置頂] Linux DM9000網絡卡驅動程式完全分析 分類: Linux裝置驅動程式第三版學習筆記 2011-02-26 16:11 3513人閱讀 評論(34) 收藏 舉報 說明1:本文分析基於核心原始碼版本為linux-2
S3C6410開發全紀錄(三)《UBOOT中新增DM9000AE網絡卡驅動》
我們獲得的UBOOT的程式碼中實際是有DM9000的網口驅動的,位於:driver/dm9000x.c在S3C6410的配置中,中並沒有將之開啟,而其他的晶片中有使用特別需要注意的是dm9000的驅動與dm9000AE的驅動還是有區別的,如果直接使用程式碼中自帶的dm900
cs8900網絡卡驅動解析(三)
上次說到的cs8900_start函式中,完成了中斷申請任務。什麼是中斷?中斷是一種電訊號,由硬體裝置產生,並直接送入中斷控制器的輸入引腳上,然後再由中斷控制器向處理器傳送相應的訊號。 其中中斷處理函式cs8900_interrupt沒有講。中斷處理函式是中斷髮生時系統要
Linux網絡編程學習(四) -----守護進程的建立(第三章)
mas ubi 哪裏 創建文件 for 文件 進程終止 父進程 文件系統 本文介紹一個例程daemon_init() #include <sys/types.h> #include <signal.h> #include <unistd.h&
LINUX核心升級 - 更新網絡卡驅動
分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!  
Linux網絡卡混雜模式(轉自cnblogs)
混雜模式就是接收所有經過網絡卡的資料包,包括不是發給本機的包,即不驗證MAC地址。普通模式下網絡卡只接收發給本機的包(包括廣播包)傳遞給上層程式,其它的包一律丟棄。 一般來說,混雜模式不會影響網絡卡的正常工作,多在網路監聽工具上使用。網絡卡具有如下的幾種工作模式: 1) 廣播模式(Broad Cas
初識Linux 驅動移植 之 dm9621網絡卡驅動移植
概述 將kernel移植到開發板並能正常載入和啟動核心後,發現網絡卡並沒有工作,因此將網絡卡作為第一個移植的實踐。這篇文章用於記錄移植dm9621網絡卡過程中遇到的問題以及如何定位問題並嘗試解決。 配置核心 在找到dm9621網絡卡驅動的原始碼後,需要將其新增
新裝linux系統沒有網絡卡驅動的解決方法
最近公司伺服器剛裝完centos6.0系統,發現只有一個lo網絡卡,沒有eth0也沒有ifcfg-eth0檔案,可以初步說明沒有網絡卡驅動 1.首先下載一個centos6.0的網絡卡驅動(舊版本的網絡卡驅動網上很難找,本人網上沒找到,最後通過客服人員才獲得,已經
Kali Linux ——在無網路情況下安裝無線網絡卡驅動
1、背景: 今日剛剛開始學習kali linux,眾所周知,安裝完成後,系統是沒有無線網絡卡驅動的,這就對學生黨造成相當的困擾:校園網要連線有線是需要認證客戶端的,而認證客戶端只有windows端,如此一來,無線網也連不上,有線網也連不上,這就......很尷尬。 因此我走訪各大部落格,雖然沒能直接解
linux下編譯新核心,解決無法找到eth0裝置問題,安裝eth0網絡卡驅動
由於我的blktrace執行時出現問題,只能對裝置測試一次,第二次的時候就會報如下錯誤:no such file or directory google瞭解決方案,很多都說是核心版本的問題,簡單的方法解決不了啊,測試不能不做啊,所以今天只能果斷換核心版本了(不過我想說每編一次核心,都會遇到新的
Kali linux下拓實N95外接網絡卡驅動安裝教程
1.把linux系統這個資料夾複製到虛擬機器 2.已完成複製 3.開啟linux系統這個檔案 並在資料夾裡 點選右鍵打 然後在終端開啟 4.開的終端 5.輸入解壓命令tar -jxvf RT3070LinuxV2.5.0.