⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lint.h

📁 SMSC 9118 Driver for linux
💻 H
字号:
/***************************************************************************
 *
 * Copyright (C) 2004-2005  SMSC
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 ***************************************************************************
 * Additionally it deserves noting that the everything in this file is
 *   for the purpose of making the lint tool happy. Therefore everything
 *   declared or defined in this file has been thoroughly customized. It
 *   is not suitable to be use as a reference nor compatible for any 
 *   other purpose.
 *   For proper declarations and definitions see the linux source code.
 ***************************************************************************
 * File: lint.h
 */

#ifndef LINT_H
#define LINT_H

#define LINUX_VERSION_CODE 132113
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

typedef unsigned long spinlock_t;
typedef unsigned long ULONG;
typedef unsigned char UCHAR;

struct net_device_stats
{
	ULONG	rx_packets;
	ULONG	tx_packets;
	ULONG	rx_bytes;
	ULONG	tx_bytes;
	ULONG	rx_errors;
	ULONG	tx_errors;
	ULONG	rx_dropped;
	ULONG	multicast;
	ULONG	collisions;
	ULONG	rx_length_errors;
	ULONG	rx_crc_errors;
	ULONG	tx_aborted_errors;
	ULONG	tx_carrier_errors;
};

struct timer_list {
	ULONG expires;
	ULONG data;
	void (*function)(ULONG param);
};

#define MODULE_PARM(var,type)		 	\
const char __module_parm_##var[] = type

#define MODULE_PARM_DESC(var,desc)		\
const char __module_parm_desc_##var[] = desc

#define MODULE_LICENSE(license) 	\
static const char __module_license[] =license

#define MOD_INC_USE_COUNT	do { } while (0)
#define MOD_DEC_USE_COUNT	do { } while (0)

#define IFNAMSIZ	(10)
#define MAX_ADDR_LEN (6)

struct dev_mc_list
{	
	struct dev_mc_list	*next;
	UCHAR dmi_addr[MAX_ADDR_LEN];
	UCHAR dmi_addrlen;
};

struct net_device
{
	char name[IFNAMSIZ];
	struct net_device_stats* (*get_stats)(struct net_device *dev);
	unsigned short flags;
	spinlock_t xmit_lock;
	void * priv;
	UCHAR dev_addr[MAX_ADDR_LEN];
	struct dev_mc_list * mc_list;
	int mc_count;
	int (*init)(struct net_device *dev);
	int	(*open)(struct net_device *dev);
	int	(*stop)(struct net_device *dev);
	int	(*hard_start_xmit) (struct sk_buff *skb,struct net_device *dev);
	void (*set_multicast_list)(struct net_device *dev);
};

struct sk_buff {
	struct net_device	*dev;
	unsigned int 	len;
	unsigned char	ip_summed;
	unsigned short	protocol;
	unsigned char	*head;
	unsigned char	*data;
	unsigned char	*tail;
};

struct tasklet_struct
{
	struct tasklet_struct *next;
	unsigned long state;
	unsigned long count;
	void (*func)(unsigned long param);
	unsigned long data;
};

#define DECLARE_TASKLET(name, func, data) \
struct tasklet_struct name = { NULL, 0, 0, func, data }

extern struct sk_buff *dev_alloc_skb(unsigned int length);
extern unsigned short eth_type_trans(struct sk_buff *skb, struct net_device *dev);
extern void netif_carrier_on(struct net_device *dev);
extern void netif_carrier_off(struct net_device *dev);
extern int netif_rx(struct sk_buff *skb);
extern void netif_start_queue(struct net_device *dev);
extern void netif_wake_queue(struct net_device *dev);
extern void netif_stop_queue(struct net_device *dev);
extern void memset(void *__s, int __c, unsigned int __count);
extern void memcpy(void *a,const void * b,unsigned int c);
extern void free_irq(unsigned int Irq, void *isr);
extern int check_mem_region(unsigned long a, unsigned long b);
extern void release_mem_region(unsigned long a, unsigned long b);
extern void tasklet_schedule(struct tasklet_struct *t);
extern void del_timer_sync(struct timer_list * timer);
extern void init_timer(struct timer_list * timer);
extern void ether_setup(struct net_device *dev);
extern int register_netdev(struct net_device *dev);
extern void add_timer(struct timer_list * timer);
extern void spin_lock(spinlock_t *s);
extern void spin_unlock(spinlock_t *s);
extern void spin_lock_init(spinlock_t *s);
//extern void spin_lock_irqsave(spinlock_t *s,unsigned long f);
//extern void spin_unlock_irqrestore(spinlock_t *s,unsigned long f);
extern void unregister_netdev(struct net_device *dev);
extern void udelay(unsigned long usecs);
#define SET_MODULE_OWNER(some_struct) do { } while (0)
extern void strcpy(signed char * s,const signed char * s);
extern void request_mem_region(unsigned long start, unsigned long n, const signed char *name);
extern int request_irq(unsigned int a,
		       void (*handler)(int a, void * b, struct pt_regs * c),
		       unsigned long c, const signed char * d, void * e);
extern void dev_kfree_skb(struct sk_buff *skb);
extern void skb_reserve(struct sk_buff *skb, unsigned int len);
extern void skb_put(struct sk_buff *skb, unsigned int len);
extern void sprintf(char * a,const char * b,...);


#define NET_RX_SUCCESS		0
#define NET_RX_DROP			1
#define NET_RX_CN_LOW		2
#define NET_RX_CN_MOD		3
#define NET_RX_CN_HIGH		4

#define CHECKSUM_NONE 0

#define	ENOMEM		12
#define	EFAULT		14
#define	ENODEV		19

#define GFP_KERNEL	(1)

#define IFF_MULTICAST   (1U)
#define IFF_PROMISC		(2U)
#define IFF_ALLMULTI	(4U)

#define SA_INTERRUPT	0x20000000 

extern void *kmalloc(unsigned int a, int b);
extern void kfree(const void *a);

extern unsigned long volatile jiffies;
#define HZ 100

#define NULL ((void *)(0))

#endif //LINT_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -