/*
* 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 (jiffies) of
last transmit*/
unsigned long last_rx; /* Time of last Rx*/
unsigned shortflags; /* interface flags (BSD)*/
unsigned shortfamily;/* address family ID*/
unsigned shortmetric;/* routing metric */
unsigned shortmtu; /* MTU value*/
unsigned shorttype;/* hardware type*/
unsigned shorthard_header_len; /* hardware hdr len */
void*priv; /* private data */
/* Interface address info. */
unsigned char broadcast[MAX_ADDR_LEN];
unsigned char pad;
unsigned char dev_addr[MAX_ADDR_LEN];
unsigned char addr_len;/* hardware addr len*/
unsigned long pa_addr; /* protocol address */
unsigned long pa_brdaddr;/* protocol broadcast addr*/
unsigned long pa_dstaddr;/* protocol P-P other addr*/
unsigned long pa_mask; /* protocol netmask */
unsigned shortpa_alen; /* protocol address len */
struct dev_mc_list*mc_list;/* M"cast mac addrs */
int mc_count;/* No installed mcasts*/
struct ip_mc_list *ip_mc_list; /* IP m"cast filter chain */
__u32 tx_queue_len;/* Max frames per queue */
/* For load balancing driver pair support */
unsigned long pkt_queue; /* Packets queued */
struct device *slave;/* Slave device */
struct net_alias_info *alias_info; /* main dev alias info*/
struct net_alias*my_alias; /* alias devs */
/* Pointer to the interface buffers. */
struct sk_buff_head buffs[DEV_NUMBUFFS];
/* Pointers to interface service routines. */
int (*open)(struct device *dev);
int (*stop)(struct device *dev);
int (*hard_start_xmit) (struct sk_buff *skb,
struct device *dev);
int (*hard_header) (struct sk_buff *skb,
struct device *dev,
unsigned short type,
void *daddr,
void *saddr,
unsigned len);
int (*rebuild_header)(void *eth,
struct device *dev,
unsigned long raddr,
struct sk_buff *skb);
void(*set_multicast_list)(struct device *dev);
int (*set_mac_address)(struct device *dev,
void *addr);
int (*do_ioctl)(struct device *dev,
struct ifreq *ifr,
int cmd);
int (*set_config)(struct device *dev,
struct ifmap *map);
void(*header_cache_bind)(struct hh_cache **hhp,
struct device *dev,
unsigned short htype,
__u32 daddr);
void(*header_cache_update)(struct hh_cache *hh,
struct device *dev,
unsigned char *haddr);
int (*change_mtu)(struct device *dev,
int new_mtu);
struct iw_statistics* (*get_wireless_stats)(struct device *dev);
};
device_struct
此结构被块设备和字符设备用来向核心登记(包含设备名称以及可对此设备进行的文件操作) 。chrdevs和blkdevs 中的每个有效分别表示一个字符设备和块设备 。
struct device_struct {
const char * name;
struct file_operations * fops;
};
file
每个打开的文件、套接口都用此结构表示 。
struct file {
mode_t f_mode;
loff_t f_pos;
unsigned short f_flags;
unsigned short f_count;
unsigned long f_reada, f_ramax, f_raend, f_ralen, f_rawin;
struct file *f_next, *f_prev;
int f_owner; /* pid or -pgrp where SIGIO should be sent */
推荐阅读
- Linux 核心--17.关于Linux的Web与FTP站点 --18.作者简介
- Linux 核心--13.Linux动态模块
- Linux 核心--14.处理器
- Linux 核心--15.Linux内核资源
- Linux 核心--12.Linux内核机制
- Linux 核心--11.网络
- Linux 核心--10.文件系统
- 诺基亚将在更多产品上采用Linux操作系统
- 蛤蟆皮的功效与作用 蛤蟆皮的功效
- Linux 核心--7.PCI设备
