public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/4910: Cannot compile kernel 2.4.14 8139too.c network driver
@ 2001-11-14 10:56 imacat
0 siblings, 0 replies; only message in thread
From: imacat @ 2001-11-14 10:56 UTC (permalink / raw)
To: gcc-gnats
>Number: 4910
>Category: c
>Synopsis: imacat <imacat@mail.imacat.idv.tw>
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Mon Nov 19 15:26:02 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: imacat <imacat@mail.imacat.idv.tw>
>Release: 3.0.2
>Organization:
none
>Environment:
Linux 2.4.9-13 Red Hat 7.2 glibc 2.2.4
System: Linux rinse.wov.idv.tw 2.4.9-13 #1 Tue Oct 30 20:11:04 EST 2001 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ./configure --quiet --prefix=/usr --sysconfdir=/etc --localstatedir=/var --infodir=/usr/share/info --mandir=/usr/share/man
>Description:
Cannot compile linux kernel 2.4.14 on Red Hat 7.1 glibc 2.2.14
with network interface card driver 8139too.c
The detailed output is below:
=======================
make all_targets
make[3]: Entering directory `/usr/src/linux-2.4.14/drivers/net'
gcc -D__KERNEL__ -I/usr/src/linux-2.4.14/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -c -o 8139too.o 8139too.c
8139too.c: In function `netdev_ethtool_ioctl':
8139too.c:2432: Unrecognizable insn:
(insn/i 621 1064 1061 (parallel[
(set (reg:SI 6 ebp)
(asm_operands:SI ("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0") ("=&r") 0[
(reg/v:SI 1 edx [166])
(mem:SI (plus:SI (reg/f:SI 6 ebp)
(const_int -352 [0xfffffea0])) 0)
(mem/s:SI (plus:SI (reg:SI 0 eax [174])
(const_int 12 [0xc])) 0)
]
[
(asm_input:SI ("1"))
(asm_input:SI ("g"))
(asm_input:SI ("g"))
] ("/usr/src/linux-2.4.14/include/asm/uaccess.h") 558))
(set (reg/v:SI 1 edx [166])
(asm_operands:SI ("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0") ("=r") 1[
(reg/v:SI 1 edx [166])
(mem:SI (plus:SI (reg/f:SI 6 ebp)
(const_int -352 [0xfffffea0])) 0)
(mem/s:SI (plus:SI (reg:SI 0 eax [174])
(const_int 12 [0xc])) 0)
]
[
(asm_input:SI ("1"))
(asm_input:SI ("g"))
(asm_input:SI ("g"))
] ("/usr/src/linux-2.4.14/include/asm/uaccess.h") 558))
(clobber (reg:QI 19 dirflag))
(clobber (reg:QI 18 fpsr))
(clobber (reg:QI 17 flags))
] ) -1 (insn_list 607 (insn_list 614 (nil)))
(nil))
8139too.c:2432: Internal compiler error in reload_cse_simplify_operands, at reload1.c:8364
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
make[3]: *** [8139too.o] Error 1
make[3]: Leaving directory `/usr/src/linux-2.4.14/drivers/net'
make[2]: *** [first_rule] Error 2
make[2]: Leaving directory `/usr/src/linux-2.4.14/drivers/net'
make[1]: *** [_subdir_net] Error 2
make[1]: Leaving directory `/usr/src/linux-2.4.14/drivers'
make: *** [_dir_drivers] Error 2
>How-To-Repeat:
The preprocessor output is below:
=================================
# 145 "8139too.c"
# 1 "../../include/linux/config.h" 1
# 1 "../../include/linux/autoconf.h" 1
# 5 "../../include/linux/config.h" 2
# 146 "8139too.c" 2
# 1 "../../include/linux/module.h" 1
# 10 "../../include/linux/module.h"
# 1 "../../include/linux/config.h" 1
# 11 "../../include/linux/module.h" 2
# 1 "../../include/linux/spinlock.h" 1
# 1 "../../include/linux/config.h" 1
# 5 "../../include/linux/spinlock.h" 2
# 60 "../../include/linux/spinlock.h"
typedef struct { int gcc_is_buggy; } spinlock_t;
# 123 "../../include/linux/spinlock.h"
typedef struct { int gcc_is_buggy; } rwlock_t;
# 12 "../../include/linux/module.h" 2
# 1 "../../include/linux/list.h" 1
# 13 "../../include/linux/module.h" 2
# 25 "../../include/linux/module.h"
# 1 "../../include/asm/atomic.h" 1
# 1 "../../include/linux/config.h" 1
# 5 "../../include/asm/atomic.h" 2
# 22 "../../include/asm/atomic.h"
typedef struct { volatile int counter; } atomic_t;
# 53 "../../include/asm/atomic.h"
static __inline__ void atomic_add(int i, atomic_t *v)
{
__asm__ __volatile__(
"" "addl %1,%0"
:"=m" (v->counter)
:"ir" (i), "m" (v->counter));
}
# 69 "../../include/asm/atomic.h"
static __inline__ void atomic_sub(int i, atomic_t *v)
{
__asm__ __volatile__(
"" "subl %1,%0"
:"=m" (v->counter)
:"ir" (i), "m" (v->counter));
}
# 87 "../../include/asm/atomic.h"
static __inline__ int atomic_sub_and_test(int i, atomic_t *v)
{
unsigned char c;
__asm__ __volatile__(
"" "subl %2,%0; sete %1"
:"=m" (v->counter), "=qm" (c)
:"ir" (i), "m" (v->counter) : "memory");
return c;
}
# 105 "../../include/asm/atomic.h"
static __inline__ void atomic_inc(atomic_t *v)
{
__asm__ __volatile__(
"" "incl %0"
:"=m" (v->counter)
:"m" (v->counter));
}
# 120 "../../include/asm/atomic.h"
static __inline__ void atomic_dec(atomic_t *v)
{
__asm__ __volatile__(
"" "decl %0"
:"=m" (v->counter)
:"m" (v->counter));
}
# 137 "../../include/asm/atomic.h"
static __inline__ int atomic_dec_and_test(atomic_t *v)
{
unsigned char c;
__asm__ __volatile__(
"" "decl %0; sete %1"
:"=m" (v->counter), "=qm" (c)
:"m" (v->counter) : "memory");
return c != 0;
}
# 157 "../../include/asm/atomic.h"
static __inline__ int atomic_inc_and_test(atomic_t *v)
{
unsigned char c;
__asm__ __volatile__(
"" "incl %0; sete %1"
:"=m" (v->counter), "=qm" (c)
:"m" (v->counter) : "memory");
return c != 0;
}
# 178 "../../include/asm/atomic.h"
static __inline__ int atomic_add_negative(int i, atomic_t *v)
{
unsigned char c;
__asm__ __volatile__(
"" "addl %2,%0; sets %1"
:"=m" (v->counter), "=qm" (c)
:"ir" (i), "m" (v->counter) : "memory");
return c;
}
# 26 "../../include/linux/module.h" 2
struct exception_table_entry;
struct kernel_sym
{
unsigned long value;
char name[60];
};
struct module_symbol
{
unsigned long value;
const char *name;
};
struct module_ref
{
struct module *dep;
struct module *ref;
struct module_ref *next_ref;
};
struct module_persist;
struct module
{
unsigned long size_of_struct;
struct module *next;
const char *name;
unsigned long size;
union
{
atomic_t usecount;
long pad;
} uc;
unsigned long flags;
unsigned nsyms;
unsigned ndeps;
struct module_symbol *syms;
struct module_ref *deps;
struct module_ref *refs;
int (*init)(void);
void (*cleanup)(void);
const struct exception_table_entry *ex_table_start;
const struct exception_table_entry *ex_table_end;
const struct module_persist *persist_start;
const struct module_persist *persist_end;
int (*can_unload)(void);
int runsize;
const char *kallsyms_start;
const char *kallsyms_end;
const char *archdata_start;
const char *archdata_end;
const char *kernel_data;
};
struct module_info
{
unsigned long addr;
unsigned long size;
unsigned long flags;
long usecount;
};
# 325 "../../include/linux/module.h"
extern struct module *module_list;
# 147 "8139too.c" 2
# 1 "../../include/linux/kernel.h" 1
# 160 "../../include/linux/kernel.h"
struct sysinfo {
long uptime;
unsigned long loads[3];
unsigned long totalram;
unsigned long freeram;
unsigned long sharedram;
unsigned long bufferram;
unsigned long totalswap;
unsigned long freeswap;
unsigned short procs;
unsigned short pad;
unsigned long totalhigh;
unsigned long freehigh;
unsigned int mem_unit;
char _f[20-2*sizeof(long)-sizeof(int)];
};
# 148 "8139too.c" 2
# 1 "../../include/linux/pci.h" 1
# 276 "../../include/linux/pci.h"
# 1 "../../include/linux/pci_ids.h" 1
# 277 "../../include/linux/pci.h" 2
# 149 "8139too.c" 2
# 1 "../../include/linux/init.h" 1
# 1 "../../include/linux/config.h" 1
# 5 "../../include/linux/init.h" 2
# 48 "../../include/linux/init.h"
typedef int (*initcall_t)(void);
typedef void (*exitcall_t)(void);
extern initcall_t __initcall_start, __initcall_end;
# 61 "../../include/linux/init.h"
struct kernel_param {
const char *str;
int (*setup_func)(char *);
};
extern struct kernel_param __setup_start, __setup_end;
# 150 "8139too.c" 2
# 1 "../../include/linux/ioport.h" 1
# 15 "../../include/linux/ioport.h"
struct resource {
const char *name;
unsigned long start, end;
unsigned long flags;
struct resource *parent, *sibling, *child;
};
struct resource_list {
struct resource_list *next;
struct resource *res;
struct pci_dev *dev;
};
# 83 "../../include/linux/ioport.h"
extern struct resource ioport_resource;
extern struct resource iomem_resource;
extern int get_resource_list(struct resource *, char *buf, int size);
extern int check_resource(struct resource *root, unsigned long, unsigned long);
extern int request_resource(struct resource *root, struct resource *new);
extern int release_resource(struct resource *new);
extern int allocate_resource(struct resource *root, struct resource *new,
unsigned long size,
unsigned long min, unsigned long max,
unsigned long align,
void (*alignf)(void *, struct resource *, unsigned long),
void *alignf_data);
extern struct resource * __request_region(struct resource *, unsigned long start, unsigned long n, const char *name);
extern int __check_region(struct resource *, unsigned long, unsigned long);
extern void __release_region(struct resource *, unsigned long, unsigned long);
extern void autoirq_setup(int waittime);
extern int autoirq_report(int waittime);
# 151 "8139too.c" 2
# 1 "../../include/linux/netdevice.h" 1
# 28 "../../include/linux/netdevice.h"
# 1 "../../include/linux/if.h" 1
# 22 "../../include/linux/if.h"
# 1 "../../include/linux/types.h" 1
# 1 "../../include/linux/posix_types.h" 1
# 1 "../../include/linux/stddef.h" 1
# 5 "../../include/linux/posix_types.h" 2
# 36 "../../include/linux/posix_types.h"
typedef struct {
unsigned long fds_bits [(1024/(8 * sizeof(unsigned long)))];
} __kernel_fd_set;
typedef void (*__kernel_sighandler_t)(int);
typedef int __kernel_key_t;
# 1 "../../include/asm/posix_types.h" 1
# 10 "../../include/asm/posix_types.h"
typedef unsigned short __kernel_dev_t;
typedef unsigned long __kernel_ino_t;
typedef unsigned short __kernel_mode_t;
typedef unsigned short __kernel_nlink_t;
typedef long __kernel_off_t;
typedef int __kernel_pid_t;
typedef unsigned short __kernel_ipc_pid_t;
typedef unsigned short __kernel_uid_t;
typedef unsigned short __kernel_gid_t;
typedef unsigned int __kernel_size_t;
typedef int __kernel_ssize_t;
typedef int __kernel_ptrdiff_t;
typedef long __kernel_time_t;
typedef long __kernel_suseconds_t;
typedef long __kernel_clock_t;
typedef int __kernel_daddr_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;
typedef struct {
int __val[2];
} __kernel_fsid_t;
# 47 "../../include/linux/posix_types.h" 2
# 9 "../../include/linux/types.h" 2
# 1 "../../include/asm/types.h" 1
typedef unsigned short umode_t;
typedef __signed__ char __s8;
typedef unsigned char __u8;
typedef __signed__ short __s16;
typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
# 10 "../../include/linux/types.h" 2
typedef __kernel_fd_set fd_set;
typedef __kernel_dev_t dev_t;
typedef __kernel_ino_t ino_t;
typedef __kernel_mode_t mode_t;
typedef __kernel_nlink_t nlink_t;
typedef __kernel_off_t off_t;
typedef __kernel_pid_t pid_t;
typedef __kernel_daddr_t daddr_t;
typedef __kernel_key_t key_t;
typedef __kernel_suseconds_t suseconds_t;
# 40 "../../include/linux/types.h"
typedef __kernel_uid_t uid_t;
typedef __kernel_gid_t gid_t;
# 54 "../../include/linux/types.h"
typedef __kernel_size_t size_t;
typedef __kernel_ssize_t ssize_t;
typedef __kernel_ptrdiff_t ptrdiff_t;
typedef __kernel_time_t time_t;
typedef __kernel_clock_t clock_t;
typedef __kernel_caddr_t caddr_t;
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef unsigned char unchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
typedef __u8 u_int8_t;
typedef __s8 int8_t;
typedef __u16 u_int16_t;
typedef __s16 int16_t;
typedef __u32 u_int32_t;
typedef __s32 int32_t;
typedef __u8 uint8_t;
typedef __u16 uint16_t;
typedef __u32 uint32_t;
# 123 "../../include/linux/types.h"
struct ustat {
__kernel_daddr_t f_tfree;
__kernel_ino_t f_tinode;
char f_fname[6];
char f_fpack[6];
};
# 23 "../../include/linux/if.h" 2
# 1 "../../include/linux/socket.h" 1
# 1 "../../include/asm/socket.h" 1
# 1 "../../include/asm/sockios.h" 1
# 5 "../../include/asm/socket.h" 2
# 7 "../../include/linux/socket.h" 2
# 1 "../../include/linux/sockios.h" 1
# 21 "../../include/linux/sockios.h"
# 1 "../../include/asm/sockios.h" 1
# 22 "../../include/linux/sockios.h" 2
# 8 "../../include/linux/socket.h" 2
# 1 "../../include/linux/uio.h" 1
# 1 "../../include/linux/types.h" 1
# 5 "../../include/linux/uio.h" 2
# 19 "../../include/linux/uio.h"
struct iovec
{
void *iov_base;
__kernel_size_t iov_len;
};
# 9 "../../include/linux/socket.h" 2
# 1 "../../include/linux/types.h" 1
# 10 "../../include/linux/socket.h" 2
typedef unsigned short sa_family_t;
struct sockaddr {
sa_family_t sa_family;
char sa_data[14];
};
struct linger {
int l_onoff;
int l_linger;
};
struct msghdr {
void * msg_name;
int msg_namelen;
struct iovec * msg_iov;
__kernel_size_t msg_iovlen;
void * msg_control;
__kernel_size_t msg_controllen;
unsigned msg_flags;
};
struct cmsghdr {
__kernel_size_t cmsg_len;
int cmsg_level;
int cmsg_type;
};
# 102 "../../include/linux/socket.h"
static struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
struct cmsghdr *__cmsg)
{
struct cmsghdr * __ptr;
__ptr = (struct cmsghdr*)(((unsigned char *) __cmsg) + ( ((__cmsg->cmsg_len)+sizeof(long)-1) & ~(sizeof(long)-1) ));
if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size)
return (struct cmsghdr *)0;
return __ptr;
}
static struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg)
{
return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
}
struct ucred {
__u32 pid;
__u32 uid;
__u32 gid;
};
# 24 "../../include/linux/if.h" 2
# 61 "../../include/linux/if.h"
struct ifmap
{
unsigned long mem_start;
unsigned long mem_end;
unsigned short base_addr;
unsigned char irq;
unsigned char dma;
unsigned char port;
};
# 79 "../../include/linux/if.h"
struct ifreq
{
union
{
char ifrn_name[16];
} ifr_ifrn;
union {
struct sockaddr ifru_addr;
struct sockaddr ifru_dstaddr;
struct sockaddr ifru_broadaddr;
struct sockaddr ifru_netmask;
struct sockaddr ifru_hwaddr;
short ifru_flags;
int ifru_ivalue;
int ifru_mtu;
struct ifmap ifru_map;
char ifru_slave[16];
char ifru_newname[16];
char * ifru_data;
} ifr_ifru;
};
# 128 "../../include/linux/if.h"
struct ifconf
{
int ifc_len;
union
{
char * ifcu_buf;
struct ifreq *ifcu_req;
} ifc_ifcu;
};
# 29 "../../include/linux/netdevice.h" 2
# 1 "../../include/linux/if_ether.h" 1
# 93 "../../include/linux/if_ether.h"
struct ethhdr
{
unsigned char h_dest[6];
unsigned char h_source[6];
unsigned short h_proto;
};
# 30 "../../include/linux/netdevice.h" 2
# 1 "../../include/linux/if_packet.h" 1
struct sockaddr_pkt
{
unsigned short spkt_family;
unsigned char spkt_device[14];
unsigned short spkt_protocol;
};
struct sockaddr_ll
{
unsigned short sll_family;
unsigned short sll_protocol;
int sll_ifindex;
unsigned short sll_hatype;
unsigned char sll_pkttype;
unsigned char sll_halen;
unsigned char sll_addr[8];
};
# 43 "../../include/linux/if_packet.h"
struct tpacket_stats
{
unsigned int tp_packets;
unsigned int tp_drops;
};
struct tpacket_hdr
{
unsigned long tp_status;
unsigned int tp_len;
unsigned int tp_snaplen;
unsigned short tp_mac;
unsigned short tp_net;
unsigned int tp_sec;
unsigned int tp_usec;
};
# 82 "../../include/linux/if_packet.h"
struct tpacket_req
{
unsigned int tp_block_size;
unsigned int tp_block_nr;
unsigned int tp_frame_size;
unsigned int tp_frame_nr;
};
struct packet_mreq
{
int mr_ifindex;
unsigned short mr_type;
unsigned short mr_alen;
unsigned char mr_address[8];
};
# 31 "../../include/linux/netdevice.h" 2
# 1 "../../include/asm/atomic.h" 1
# 33 "../../include/linux/netdevice.h" 2
# 1 "../../include/asm/cache.h" 1
# 1 "../../include/linux/config.h" 1
# 8 "../../include/asm/cache.h" 2
# 34 "../../include/linux/netdevice.h" 2
# 1 "../../include/asm/byteorder.h" 1
# 1 "../../include/asm/types.h" 1
# 5 "../../include/asm/byteorder.h" 2
# 45 "../../include/asm/byteorder.h"
# 1 "../../include/linux/byteorder/little_endian.h" 1
# 11 "../../include/linux/byteorder/little_endian.h"
# 1 "../../include/linux/byteorder/swab.h" 1
# 131 "../../include/linux/byteorder/swab.h"
static __inline__ __const__ __u16 __fswab16(__u16 x)
{
return ({ __u16 __tmp = (x) ; ({ __u16 __x = (__tmp); ((__u16)( (((__u16)(__x) & (__u16)0x00ffU) << 8) | (((__u16)(__x) & (__u16)0xff00U) >> 8) )); }); });
}
static __inline__ __u16 __swab16p(__u16 *x)
{
return ({ __u16 __tmp = (*(x)) ; ({ __u16 __x = (__tmp); ((__u16)( (((__u16)(__x) & (__u16)0x00ffU) << 8) | (((__u16)(__x) & (__u16)0xff00U) >> 8) )); }); });
}
static __inline__ void __swab16s(__u16 *addr)
{
do { *(addr) = ({ __u16 __tmp = (*((addr))) ; ({ __u16 __x = (__tmp); ((__u16)( (((__u16)(__x) & (__u16)0x00ffU) << 8) | (((__u16)(__x) & (__u16)0xff00U) >> 8) )); }); }); } while (0);
}
static __inline__ __const__ __u32 __fswab32(__u32 x)
{
return ({ __u32 __tmp = (x) ; ({ __u32 __x = (__tmp); ((__u32)( (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); }); });
}
static __inline__ __u32 __swab32p(__u32 *x)
{
return ({ __u32 __tmp = (*(x)) ; ({ __u32 __x = (__tmp); ((__u32)( (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); }); });
}
static __inline__ void __swab32s(__u32 *addr)
{
do { *(addr) = ({ __u32 __tmp = (*((addr))) ; ({ __u32 __x = (__tmp); ((__u32)( (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); }); }); } while (0);
}
# 12 "../../include/linux/byteorder/little_endian.h" 2
# 66 "../../include/linux/byteorder/little_endian.h"
# 1 "../../include/linux/byteorder/generic.h" 1
# 153 "../../include/linux/byteorder/generic.h"
extern unsigned long int ntohl(unsigned long int);
extern unsigned long int htonl(unsigned long int);
extern unsigned short int ntohs(unsigned short int);
extern unsigned short int htons(unsigned short int);
# 67 "../../include/linux/byteorder/little_endian.h" 2
# 46 "../../include/asm/byteorder.h" 2
# 35 "../../include/linux/netdevice.h" 2
# 96 "../../include/linux/netdevice.h"
struct net_device_stats
{
unsigned long rx_packets;
unsigned long tx_packets;
unsigned long rx_bytes;
unsigned long tx_bytes;
unsigned long rx_errors;
unsigned long tx_errors;
unsigned long rx_dropped;
unsigned long tx_dropped;
unsigned long multicast;
unsigned long collisions;
unsigned long rx_length_errors;
unsigned long rx_over_errors;
unsigned long rx_crc_errors;
unsigned long rx_frame_errors;
unsigned long rx_fifo_errors;
unsigned long rx_missed_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;
unsigned long rx_compressed;
unsigned long tx_compressed;
};
enum {
IF_PORT_UNKNOWN = 0,
IF_PORT_10BASE2,
IF_PORT_10BASET,
IF_PORT_AUI,
IF_PORT_100BASET,
IF_PORT_100BASETX,
IF_PORT_100BASEFX
};
# 152 "8139too.c" 2
# 1 "../../include/linux/etherdevice.h" 1
# 27 "../../include/linux/etherdevice.h"
# 1 "../../include/linux/if_ether.h" 1
# 28 "../../include/linux/etherdevice.h" 2
# 153 "8139too.c" 2
# 1 "../../include/linux/rtnetlink.h" 1
# 1 "../../include/linux/netlink.h" 1
# 16 "../../include/linux/netlink.h"
struct sockaddr_nl
{
sa_family_t nl_family;
unsigned short nl_pad;
__u32 nl_pid;
__u32 nl_groups;
};
struct nlmsghdr
{
__u32 nlmsg_len;
__u16 nlmsg_type;
__u16 nlmsg_flags;
__u32 nlmsg_seq;
__u32 nlmsg_pid;
};
# 77 "../../include/linux/netlink.h"
struct nlmsgerr
{
int error;
struct nlmsghdr msg;
};
# 5 "../../include/linux/rtnetlink.h" 2
# 57 "../../include/linux/rtnetlink.h"
struct rtattr
{
unsigned short rta_len;
unsigned short rta_type;
};
# 83 "../../include/linux/rtnetlink.h"
struct rtmsg
{
unsigned char rtm_family;
unsigned char rtm_dst_len;
unsigned char rtm_src_len;
unsigned char rtm_tos;
unsigned char rtm_table;
unsigned char rtm_protocol;
unsigned char rtm_scope;
unsigned char rtm_type;
unsigned rtm_flags;
};
enum
{
RTN_UNSPEC,
RTN_UNICAST,
RTN_LOCAL,
RTN_BROADCAST,
RTN_ANYCAST,
RTN_MULTICAST,
RTN_BLACKHOLE,
RTN_UNREACHABLE,
RTN_PROHIBIT,
RTN_THROW,
RTN_NAT,
RTN_XRESOLVE,
};
# 155 "../../include/linux/rtnetlink.h"
enum rt_scope_t
{
RT_SCOPE_UNIVERSE=0,
RT_SCOPE_SITE=200,
RT_SCOPE_LINK=253,
RT_SCOPE_HOST=254,
RT_SCOPE_NOWHERE=255
};
# 173 "../../include/linux/rtnetlink.h"
enum rt_class_t
{
RT_TABLE_UNSPEC=0,
RT_TABLE_DEFAULT=253,
RT_TABLE_MAIN=254,
RT_TABLE_LOCAL=255
};
enum rtattr_type_t
{
RTA_UNSPEC,
RTA_DST,
RTA_SRC,
RTA_IIF,
RTA_OIF,
RTA_GATEWAY,
RTA_PRIORITY,
RTA_PREFSRC,
RTA_METRICS,
RTA_MULTIPATH,
RTA_PROTOINFO,
RTA_FLOW,
RTA_CACHEINFO
};
# 218 "../../include/linux/rtnetlink.h"
struct rtnexthop
{
unsigned short rtnh_len;
unsigned char rtnh_flags;
unsigned char rtnh_hops;
int rtnh_ifindex;
};
# 245 "../../include/linux/rtnetlink.h"
struct rta_cacheinfo
{
__u32 rta_clntref;
__u32 rta_lastuse;
__s32 rta_expires;
__u32 rta_error;
__u32 rta_used;
__u32 rta_id;
__u32 rta_ts;
__u32 rta_tsage;
};
enum
{
RTAX_UNSPEC,
RTAX_LOCK,
RTAX_MTU,
RTAX_WINDOW,
RTAX_RTT,
RTAX_RTTVAR,
RTAX_SSTHRESH,
RTAX_CWND,
RTAX_ADVMSS,
RTAX_REORDERING,
};
# 293 "../../include/linux/rtnetlink.h"
struct ifaddrmsg
{
unsigned char ifa_family;
unsigned char ifa_prefixlen;
unsigned char ifa_flags;
unsigned char ifa_scope;
int ifa_index;
};
enum
{
IFA_UNSPEC,
IFA_ADDRESS,
IFA_LOCAL,
IFA_LABEL,
IFA_BROADCAST,
IFA_ANYCAST,
IFA_CACHEINFO
};
# 323 "../../include/linux/rtnetlink.h"
struct ifa_cacheinfo
{
__s32 ifa_prefered;
__s32 ifa_valid;
};
# 345 "../../include/linux/rtnetlink.h"
struct ndmsg
{
unsigned char ndm_family;
unsigned char ndm_pad1;
unsigned short ndm_pad2;
int ndm_ifindex;
__u16 ndm_state;
__u8 ndm_flags;
__u8 ndm_type;
};
enum
{
NDA_UNSPEC,
NDA_DST,
NDA_LLADDR,
NDA_CACHEINFO
};
# 393 "../../include/linux/rtnetlink.h"
struct nda_cacheinfo
{
__u32 ndm_confirmed;
__u32 ndm_used;
__u32 ndm_updated;
__u32 ndm_refcnt;
};
struct rtgenmsg
{
unsigned char rtgen_family;
};
# 419 "../../include/linux/rtnetlink.h"
struct ifinfomsg
{
unsigned char ifi_family;
unsigned char __ifi_pad;
unsigned short ifi_type;
int ifi_index;
unsigned ifi_flags;
unsigned ifi_change;
};
enum
{
IFLA_UNSPEC,
IFLA_ADDRESS,
IFLA_BROADCAST,
IFLA_IFNAME,
IFLA_MTU,
IFLA_LINK,
IFLA_QDISC,
IFLA_STATS,
IFLA_COST,
IFLA_PRIORITY,
IFLA_MASTER
};
# 486 "../../include/linux/rtnetlink.h"
struct tcmsg
{
unsigned char tcm_family;
unsigned char tcm__pad1;
unsigned short tcm__pad2;
int tcm_ifindex;
__u32 tcm_handle;
__u32 tcm_parent;
__u32 tcm_info;
};
enum
{
TCA_UNSPEC,
TCA_KIND,
TCA_OPTIONS,
TCA_STATS,
TCA_XSTATS,
TCA_RATE,
};
# 154 "8139too.c" 2
# 1 "../../include/linux/delay.h" 1
# 10 "../../include/linux/delay.h"
extern unsigned long loops_per_jiffy;
# 1 "../../include/asm/delay.h" 1
# 10 "../../include/asm/delay.h"
extern void __bad_udelay(void);
extern void __udelay(unsigned long usecs);
extern void __const_udelay(unsigned long usecs);
extern void __delay(unsigned long loops);
# 13 "../../include/linux/delay.h" 2
# 155 "8139too.c" 2
# 1 "../../include/linux/ethtool.h" 1
# 13 "../../include/linux/ethtool.h"
struct ethtool_cmd {
u32 cmd;
u32 supported;
u32 advertising;
u16 speed;
u8 duplex;
u8 port;
u8 phy_address;
u8 transceiver;
u8 autoneg;
u32 maxtxpkt;
u32 maxrxpkt;
u32 reserved[4];
};
struct ethtool_drvinfo {
u32 cmd;
char driver[32];
char version[32];
char fw_version[32];
char bus_info[32];
char reserved1[32];
char reserved2[28];
u32 regdump_len;
};
struct ethtool_wolinfo {
u32 cmd;
u32 supported;
u32 wolopts;
u8 sopass[6];
};
# 156 "8139too.c" 2
# 1 "../../include/linux/mii.h" 1
# 11 "../../include/linux/mii.h"
# 1 "../../include/linux/types.h" 1
# 12 "../../include/linux/mii.h" 2
# 105 "../../include/linux/mii.h"
struct mii_ioctl_data {
u16 phy_id;
u16 reg_num;
u16 val_in;
u16 val_out;
};
# 127 "../../include/linux/mii.h"
static inline unsigned int mii_nway_result (unsigned int negotiated)
{
unsigned int ret;
if (negotiated & 0x0100)
ret = 0x0100;
else if (negotiated & 0x0200)
ret = 0x0200;
else if (negotiated & 0x0080)
ret = 0x0080;
else if (negotiated & 0x0040)
ret = 0x0040;
else
ret = 0x0020;
return ret;
}
# 154 "../../include/linux/mii.h"
static inline unsigned int mii_duplex (unsigned int duplex_lock,
unsigned int negotiated)
{
if (duplex_lock)
return 1;
if (mii_nway_result(negotiated) & (0x0040 | 0x0100))
return 1;
return 0;
}
# 157 "8139too.c" 2
# 1 "../../include/linux/completion.h" 1
# 11 "../../include/linux/completion.h"
# 1 "../../include/linux/wait.h" 1
# 12 "../../include/linux/completion.h" 2
struct completion {
unsigned int done;
wait_queue_head_t wait;
};
static inline void init_completion(struct completion *x)
{
x->done = 0;
init_waitqueue_head(&x->wait);
}
extern void FASTCALL(wait_for_completion(struct completion *));
extern void FASTCALL(complete(struct completion *));
# 158 "8139too.c" 2
# 1 "../../include/asm/io.h" 1
# 1 "../../include/linux/config.h" 1
# 5 "../../include/asm/io.h" 2
# 309 "../../include/asm/io.h"
static inline unsigned char inb(unsigned short port) { unsigned char _v; __asm__ __volatile__ ("in" "b" " %" "w" "1,%" "" "0" : "=a" (_v) : "Nd" (port) ); return _v; } static inline unsigned char inb_p(unsigned short port) { unsigned char _v; __asm__ __volatile__ ("in" "b" " %" "w" "1,%" "" "0" "\noutb %%al,$0x80" : "=a" (_v) : "Nd" (port) ); return _v; }
static inline unsigned short inw(unsigned short port) { unsigned short _v; __asm__ __volatile__ ("in" "w" " %" "w" "1,%" "" "0" : "=a" (_v) : "Nd" (port) ); return _v; } static inline unsigned short inw_p(unsigned short port) { unsigned short _v; __asm__ __volatile__ ("in" "w" " %" "w" "1,%" "" "0" "\noutb %%al,$0x80" : "=a" (_v) : "Nd" (port) ); return _v; }
static inline unsigned int inl(unsigned short port) { unsigned int _v; __asm__ __volatile__ ("in" "l" " %" "w" "1,%" "" "0" : "=a" (_v) : "Nd" (port) ); return _v; } static inline unsigned int inl_p(unsigned short port) { unsigned int _v; __asm__ __volatile__ ("in" "l" " %" "w" "1,%" "" "0" "\noutb %%al,$0x80" : "=a" (_v) : "Nd" (port) ); return _v; }
static inline void outb(unsigned char value, unsigned short port) { __asm__ __volatile__ ("out" "b" " %" "b" "0,%" "w" "1" : : "a" (value), "Nd" (port)); } static inline void outb_p(unsigned char value, unsigned short port) { __asm__ __volatile__ ("out" "b" " %" "b" "0,%" "w" "1" "\noutb %%al,$0x80" : : "a" (value), "Nd" (port));}
static inline void outw(unsigned short value, unsigned short port) { __asm__ __volatile__ ("out" "w" " %" "w" "0,%" "w" "1" : : "a" (value), "Nd" (port)); } static inline void outw_p(unsigned short value, unsigned short port) { __asm__ __volatile__ ("out" "w" " %" "w" "0,%" "w" "1" "\noutb %%al,$0x80" : : "a" (value), "Nd" (port));}
static inline void outl(unsigned int value, unsigned short port) { __asm__ __volatile__ ("out" "l" " %" "0,%" "w" "1" : : "a" (value), "Nd" (port)); } static inline void outl_p(unsigned int value, unsigned short port) { __asm__ __volatile__ ("out" "l" " %" "0,%" "w" "1" "\noutb %%al,$0x80" : : "a" (value), "Nd" (port));}
static inline void insb(unsigned short port, void * addr, unsigned long count) { __asm__ __volatile__ ("rep ; ins" "b" : "=D" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }
static inline void insw(unsigned short port, void * addr, unsigned long count) { __asm__ __volatile__ ("rep ; ins" "w" : "=D" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }
static inline void insl(unsigned short port, void * addr, unsigned long count) { __asm__ __volatile__ ("rep ; ins" "l" : "=D" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }
static inline void outsb(unsigned short port, const void * addr, unsigned long count) { __asm__ __volatile__ ("rep ; outs" "b" : "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }
static inline void outsw(unsigned short port, const void * addr, unsigned long count) { __asm__ __volatile__ ("rep ; outs" "w" : "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }
static inline void outsl(unsigned short port, const void * addr, unsigned long count) { __asm__ __volatile__ ("rep ; outs" "l" : "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }
# 159 "8139too.c" 2
# 1 "../../include/asm/uaccess.h" 1
# 1 "../../include/linux/config.h" 1
# 8 "../../include/asm/uaccess.h" 2
# 1 "../../include/linux/sched.h" 1
# 1 "../../include/asm/param.h" 1
# 5 "../../include/linux/sched.h" 2
extern unsigned long event;
# 1 "../../include/linux/config.h" 1
# 9 "../../include/linux/sched.h" 2
# 1 "../../include/linux/binfmts.h" 1
# 1 "../../include/linux/ptrace.h" 1
# 24 "../../include/linux/ptrace.h"
# 1 "../../include/asm/ptrace.h" 1
# 26 "../../include/asm/ptrace.h"
struct pt_regs {
long ebx;
long ecx;
long edx;
long esi;
long edi;
long ebp;
long eax;
int xds;
int xes;
long orig_eax;
long eip;
int xcs;
long eflags;
long esp;
int xss;
};
# 25 "../../include/linux/ptrace.h" 2
# 5 "../../include/linux/binfmts.h" 2
# 1 "../../include/linux/capability.h" 1
# 16 "../../include/linux/capability.h"
# 1 "../../include/linux/types.h" 1
# 17 "../../include/linux/capability.h" 2
# 1 "../../include/linux/fs.h" 1
# 9 "../../include/linux/fs.h"
# 1 "../../include/linux/config.h" 1
# 10 "../../include/linux/fs.h" 2
# 1 "../../include/linux/linkage.h" 1
# 1 "../../include/linux/config.h" 1
# 5 "../../include/linux/linkage.h" 2
# 11 "../../include/linux/fs.h" 2
# 1 "../../include/linux/limits.h" 1
# 12 "../../include/linux/fs.h" 2
# 1 "../../include/linux/wait.h" 1
# 13 "../../include/linux/fs.h" 2
# 1 "../../include/linux/types.h" 1
# 14 "../../include/linux/fs.h" 2
# 1 "../../include/linux/vfs.h" 1
# 1 "../../include/asm/statfs.h" 1
# 1 "../../include/linux/types.h" 1
# 7 "../../include/asm/statfs.h" 2
typedef __kernel_fsid_t fsid_t;
struct statfs {
long f_type;
long f_bsize;
long f_blocks;
long f_bfree;
long f_bavail;
long f_files;
long f_ffree;
__kernel_fsid_t f_fsid;
long f_namelen;
long f_spare[6];
};
# 5 "../../include/linux/vfs.h" 2
# 15 "../../include/linux/fs.h" 2
# 1 "../../include/linux/net.h" 1
# 21 "../../include/linux/net.h"
# 1 "../../include/linux/config.h" 1
# 22 "../../include/linux/net.h" 2
# 1 "../../include/linux/socket.h" 1
# 23 "../../include/linux/net.h" 2
# 1 "../../include/linux/wait.h" 1
# 24 "../../include/linux/net.h" 2
struct poll_table_struct;
# 49 "../../include/linux/net.h"
typedef enum {
SS_FREE = 0,
SS_UNCONNECTED,
SS_CONNECTING,
SS_CONNECTED,
SS_DISCONNECTING
} socket_state;
# 16 "../../include/linux/fs.h" 2
# 1 "../../include/linux/kdev_t.h" 1
# 17 "../../include/linux/fs.h" 2
# 1 "../../include/linux/ioctl.h" 1
# 1 "../../include/asm/ioctl.h" 1
# 5 "../../include/linux/ioctl.h" 2
# 18 "../../include/linux/fs.h" 2
# 1 "../../include/linux/list.h" 1
# 19 "../../include/linux/fs.h" 2
# 1 "../../include/linux/dcache.h" 1
# 20 "../../include/linux/fs.h" 2
# 1 "../../include/linux/stat.h" 1
# 21 "../../include/linux/fs.h" 2
# 1 "../../include/linux/cache.h" 1
# 1 "../../include/linux/config.h" 1
# 5 "../../include/linux/cache.h" 2
# 1 "../../include/asm/cache.h" 1
# 6 "../../include/linux/cache.h" 2
# 22 "../../include/linux/fs.h" 2
# 1 "../../include/linux/stddef.h" 1
# 23 "../../include/linux/fs.h" 2
# 1 "../../include/linux/string.h" 1
# 24 "../../include/linux/fs.h" 2
# 1 "../../include/asm/atomic.h" 1
# 26 "../../include/linux/fs.h" 2
# 1 "../../include/asm/bitops.h" 1
# 1 "../../include/linux/config.h" 1
# 9 "../../include/asm/bitops.h" 2
# 36 "../../include/asm/bitops.h"
static __inline__ void set_bit(int nr, volatile void * addr)
{
__asm__ __volatile__( ""
"btsl %1,%0"
:"=m" ((*(volatile long *) addr))
:"Ir" (nr));
}
# 53 "../../include/asm/bitops.h"
static __inline__ void __set_bit(int nr, volatile void * addr)
{
__asm__(
"btsl %1,%0"
:"=m" ((*(volatile long *) addr))
:"Ir" (nr));
}
# 71 "../../include/asm/bitops.h"
static __inline__ void clear_bit(int nr, volatile void * addr)
{
__asm__ __volatile__( ""
"btrl %1,%0"
:"=m" ((*(volatile long *) addr))
:"Ir" (nr));
}
# 90 "../../include/asm/bitops.h"
static __inline__ void __change_bit(int nr, volatile void * addr)
{
__asm__ __volatile__(
"btcl %1,%0"
:"=m" ((*(volatile long *) addr))
:"Ir" (nr));
}
# 107 "../../include/asm/bitops.h"
static __inline__ void change_bit(int nr, volatile void * addr)
{
__asm__ __volatile__( ""
"btcl %1,%0"
:"=m" ((*(volatile long *) addr))
:"Ir" (nr));
}
# 123 "../../include/asm/bitops.h"
static __inline__ int test_and_set_bit(int nr, volatile void * addr)
{
int oldbit;
__asm__ __volatile__( ""
"btsl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" ((*(volatile long *) addr))
:"Ir" (nr) : "memory");
return oldbit;
}
# 143 "../../include/asm/bitops.h"
static __inline__ int __test_and_set_bit(int nr, volatile void * addr)
{
int oldbit;
__asm__(
"btsl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" ((*(volatile long *) addr))
:"Ir" (nr));
return oldbit;
}
# 162 "../../include/asm/bitops.h"
static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
{
int oldbit;
__asm__ __volatile__( ""
"btrl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" ((*(volatile long *) addr))
:"Ir" (nr) : "memory");
return oldbit;
}
# 182 "../../include/asm/bitops.h"
static __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
{
int oldbit;
__asm__(
"btrl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" ((*(volatile long *) addr))
:"Ir" (nr));
return oldbit;
}
static __inline__ int __test_and_change_bit(int nr, volatile void * addr)
{
int oldbit;
__asm__ __volatile__(
"btcl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" ((*(volatile long *) addr))
:"Ir" (nr) : "memory");
return oldbit;
}
# 213 "../../include/asm/bitops.h"
static __inline__ int test_and_change_bit(int nr, volatile void * addr)
{
int oldbit;
__asm__ __volatile__( ""
"btcl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" ((*(volatile long *) addr))
:"Ir" (nr) : "memory");
return oldbit;
}
# 233 "../../include/asm/bitops.h"
static __inline__ int constant_test_bit(int nr, const volatile void * addr)
{
return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
}
static __inline__ int variable_test_bit(int nr, volatile void * addr)
{
int oldbit;
__asm__ __volatile__(
"btl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit)
:"m" ((*(volatile long *) addr)),"Ir" (nr));
return oldbit;
}
# 262 "../../include/asm/bitops.h"
static __inline__ int find_first_zero_bit(void * addr, unsigned size)
{
int d0, d1, d2;
int res;
if (!size)
return 0;
__asm__ __volatile__(
"movl $-1,%%eax\n\t"
"xorl %%edx,%%edx\n\t"
"repe; scasl\n\t"
"je 1f\n\t"
"xorl -4(%%edi),%%eax\n\t"
"subl $4,%%edi\n\t"
"bsfl %%eax,%%edx\n"
"1:\tsubl %%ebx,%%edi\n\t"
"shll $3,%%edi\n\t"
"addl %%edi,%%edx"
:"=d" (res), "=&c" (d0), "=&D" (d1), "=&a" (d2)
:"1" ((size + 31) >> 5), "2" (addr), "b" (addr));
return res;
}
static __inline__ int find_next_zero_bit (void * addr, int size, int offset)
{
unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
int set = 0, bit = offset & 31, res;
if (bit) {
__asm__("bsfl %1,%0\n\t"
"jne 1f\n\t"
"movl $32, %0\n"
"1:"
: "=r" (set)
: "r" (~(*p >> bit)));
if (set < (32 - bit))
return set + offset;
set = 32 - bit;
p++;
}
res = find_first_zero_bit (p, size - 32 * (p - (unsigned long *) addr));
return (offset + set + res);
}
static __inline__ unsigned long ffz(unsigned long word)
{
__asm__("bsfl %1,%0"
:"=r" (word)
:"r" (~word));
return word;
}
# 27 "../../include/linux/fs.h" 2
struct poll_table_struct;
# 50 "../../include/linux/fs.h"
struct files_stat_struct {
int nr_files;
int nr_free_files;
int max_files;
};
extern struct files_stat_struct files_stat;
struct inodes_stat_t {
int nr_inodes;
int nr_unused;
int dummy[5];
};
extern struct inodes_stat_t inodes_stat;
extern int leases_enable, dir_notify_enable, lease_break_time;
# 18 "../../include/linux/capability.h" 2
# 32 "../../include/linux/capability.h"
typedef struct __user_cap_header_struct {
__u32 version;
int pid;
} *cap_user_header_t;
typedef struct __user_cap_data_struct {
__u32 effective;
__u32 permitted;
__u32 inheritable;
} *cap_user_data_t;
# 6 "../../include/linux/binfmts.h" 2
# 10 "../../include/linux/sched.h" 2
# 1 "../../include/linux/threads.h" 1
# 1 "../../include/linux/config.h" 1
# 5 "../../include/linux/threads.h" 2
# 11 "../../include/linux/sched.h" 2
# 1 "../../include/linux/kernel.h" 1
# 12 "../../include/linux/sched.h" 2
# 1 "../../include/linux/types.h" 1
# 13 "../../include/linux/sched.h" 2
# 1 "../../include/linux/times.h" 1
struct tms {
clock_t tms_utime;
clock_t tms_stime;
clock_t tms_cutime;
clock_t tms_cstime;
};
# 14 "../../include/linux/sched.h" 2
# 1 "../../include/linux/timex.h" 1
# 54 "../../include/linux/timex.h"
# 1 "../../include/asm/param.h" 1
# 55 "../../include/linux/timex.h" 2
# 152 "../../include/linux/timex.h"
# 1 "../../include/asm/timex.h" 1
# 9 "../../include/asm/timex.h"
# 1 "../../include/linux/config.h" 1
# 10 "../../include/asm/timex.h" 2
# 1 "../../include/asm/msr.h" 1
# 11 "../../include/asm/timex.h" 2
# 32 "../../include/asm/timex.h"
typedef unsigned long long cycles_t;
extern cycles_t cacheflush_time;
static inline cycles_t get_cycles (void)
{
unsigned long long ret;
__asm__ __volatile__("rdtsc" : "=A" (ret));
return ret;
}
extern unsigned long cpu_khz;
# 153 "../../include/linux/timex.h" 2
# 161 "../../include/linux/timex.h"
struct timex {
unsigned int modes;
long offset;
long freq;
long maxerror;
long esterror;
int status;
long constant;
long precision;
long tolerance;
struct timeval time;
long tick;
long ppsfreq;
long jitter;
int shift;
long stabil;
long jitcnt;
long calcnt;
long errcnt;
long stbcnt;
int :32; int :32; int :32; int :32;
int :32; int :32; int :32; int :32;
int :32; int :32; int :32; int :32;
};
# 15 "../../include/linux/sched.h" 2
# 1 "../../include/linux/rbtree.h" 1
# 97 "../../include/linux/rbtree.h"
# 1 "../../include/linux/kernel.h" 1
# 98 "../../include/linux/rbtree.h" 2
# 1 "../../include/linux/stddef.h" 1
# 99 "../../include/linux/rbtree.h" 2
typedef struct rb_node_s
{
struct rb_node_s * rb_parent;
int rb_color;
struct rb_node_s * rb_right;
struct rb_node_s * rb_left;
}
rb_node_t;
typedef struct rb_root_s
{
struct rb_node_s * rb_node;
}
rb_root_t;
extern void rb_insert_color(rb_node_t *, rb_root_t *);
extern void rb_erase(rb_node_t *, rb_root_t *);
static inline void rb_link_node(rb_node_t * node, rb_node_t * parent, rb_node_t ** rb_link)
{
node->rb_parent = parent;
node->rb_color = 0;
node->rb_left = node->rb_right = ((void *)0);
*rb_link = node;
}
# 16 "../../include/linux/sched.h" 2
# 1 "../../include/asm/system.h" 1
# 1 "../../include/linux/config.h" 1
# 5 "../../include/asm/system.h" 2
# 1 "../../include/linux/kernel.h" 1
# 6 "../../include/asm/system.h" 2
# 1 "../../include/asm/segment.h" 1
# 7 "../../include/asm/system.h" 2
# 1 "../../include/linux/bitops.h" 1
# 11 "../../include/linux/bitops.h"
static inline int generic_ffs(int x)
{
int r = 1;
if (!x)
return 0;
if (!(x & 0xffff)) {
x >>= 16;
r += 16;
}
if (!(x & 0xff)) {
x >>= 8;
r += 8;
}
if (!(x & 0xf)) {
x >>= 4;
r += 4;
}
if (!(x & 3)) {
x >>= 2;
r += 2;
}
if (!(x & 1)) {
x >>= 1;
r += 1;
}
return r;
}
static inline unsigned int generic_hweight32(unsigned int w)
{
unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555);
res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
res = (res & 0x0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F);
res = (res & 0x00FF00FF) + ((res >> 8) & 0x00FF00FF);
return (res & 0x0000FFFF) + ((res >> 16) & 0x0000FFFF);
}
static inline unsigned int generic_hweight16(unsigned int w)
{
unsigned int res = (w & 0x5555) + ((w >> 1) & 0x5555);
res = (res & 0x3333) + ((res >> 2) & 0x3333);
res = (res & 0x0F0F) + ((res >> 4) & 0x0F0F);
return (res & 0x00FF) + ((res >> 8) & 0x00FF);
}
static inline unsigned int generic_hweight8(unsigned int w)
{
unsigned int res = (w & 0x55) + ((w >> 1) & 0x55);
res = (res & 0x33) + ((res >> 2) & 0x33);
return (res & 0x0F) + ((res >> 4) & 0x0F);
}
# 1 "../../include/asm/bitops.h" 1
# 70 "../../include/linux/bitops.h" 2
# 8 "../../include/asm/system.h" 2
# 130 "../../include/asm/system.h"
static inline unsigned long get_limit(unsigned long segment)
{
unsigned long __limit;
__asm__("lsll %1,%0"
:"=r" (__limit):"r" (segment));
return __limit+1;
}
struct __xchg_dummy { unsigned long a[100]; };
# 157 "../../include/asm/system.h"
static inline void __set_64bit (unsigned long long * ptr,
unsigned int low, unsigned int high)
{
__asm__ __volatile__ (
"\n1:\t"
"movl (%0), %%eax\n\t"
"movl 4(%0), %%edx\n\t"
"cmpxchg8b (%0)\n\t"
"jnz 1b"
:
: "D"(ptr),
"b"(low),
"c"(high)
: "ax","dx","memory");
}
static inline void __set_64bit_constant (unsigned long long *ptr,
unsigned long long value)
{
__set_64bit(ptr,(unsigned int)(value), (unsigned int)((value)>>32ULL));
}
static inline void __set_64bit_var (unsigned long long *ptr,
unsigned long long value)
{
__set_64bit(ptr,*(((unsigned int*)&(value))+0), *(((unsigned int*)&(value))+1));
}
# 202 "../../include/asm/system.h"
static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
{
switch (size) {
case 1:
__asm__ __volatile__("xchgb %b0,%1"
:"=q" (x)
:"m" (*((struct __xchg_dummy *)(ptr))), "0" (x)
:"memory");
break;
case 2:
__asm__ __volatile__("xchgw %w0,%1"
:"=r" (x)
:"m" (*((struct __xchg_dummy *)(ptr))), "0" (x)
:"memory");
break;
case 4:
__asm__ __volatile__("xchgl %0,%1"
:"=r" (x)
:"m" (*((struct __xchg_dummy *)(ptr))), "0" (x)
:"memory");
break;
}
return x;
}
# 236 "../../include/asm/system.h"
static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
unsigned long new, int size)
{
unsigned long prev;
switch (size) {
case 1:
__asm__ __volatile__("" "cmpxchgb %b1,%2"
: "=a"(prev)
: "q"(new), "m"(*((struct __xchg_dummy *)(ptr))), "0"(old)
: "memory");
return prev;
case 2:
__asm__ __volatile__("" "cmpxchgw %w1,%2"
: "=a"(prev)
: "q"(new), "m"(*((struct __xchg_dummy *)(ptr))), "0"(old)
: "memory");
return prev;
case 4:
__asm__ __volatile__("" "cmpxchgl %1,%2"
: "=a"(prev)
: "q"(new), "m"(*((struct __xchg_dummy *)(ptr))), "0"(old)
: "memory");
return prev;
}
return old;
}
# 349 "../../include/asm/system.h"
void disable_hlt(void);
void enable_hlt(void);
extern int is_sony_vaio_laptop;
# 18 "../../include/linux/sched.h" 2
# 1 "../../include/asm/semaphore.h" 1
# 1 "../../include/linux/linkage.h" 1
# 5 "../../include/asm/semaphore.h" 2
# 19 "../../include/linux/sched.h" 2
# 1 "../../include/asm/page.h" 1
# 20 "../../include/linux/sched.h" 2
# 1 "../../include/asm/ptrace.h" 1
# 21 "../../include/linux/sched.h" 2
# 1 "../../include/asm/mmu.h" 1
typedef struct {
void *segments;
unsigned long cpuvalid;
} mm_context_t;
# 22 "../../include/linux/sched.h" 2
# 1 "../../include/linux/smp.h" 1
# 9 "../../include/linux/smp.h"
# 1 "../../include/linux/config.h" 1
# 10 "../../include/linux/smp.h" 2
# 24 "../../include/linux/sched.h" 2
# 1 "../../include/linux/tty.h" 1
# 25 "../../include/linux/sched.h" 2
# 1 "../../include/linux/sem.h" 1
# 1 "../../include/linux/ipc.h" 1
# 1 "../../include/linux/types.h" 1
# 5 "../../include/linux/ipc.h" 2
struct ipc_perm
{
__kernel_key_t key;
__kernel_uid_t uid;
__kernel_gid_t gid;
__kernel_uid_t cuid;
__kernel_gid_t cgid;
__kernel_mode_t mode;
unsigned short seq;
};
# 1 "../../include/asm/ipcbuf.h" 1
# 14 "../../include/asm/ipcbuf.h"
struct ipc64_perm
{
__kernel_key_t key;
__kernel_uid32_t uid;
__kernel_gid32_t gid;
__kernel_uid32_t cuid;
__kernel_gid32_t cgid;
__kernel_mode_t mode;
unsigned short __pad1;
unsigned short seq;
unsigned short __pad2;
unsigned long __unused1;
unsigned long __unused2;
};
# 22 "../../include/linux/ipc.h" 2
# 5 "../../include/linux/sem.h" 2
# 23 "../../include/linux/sem.h"
struct semid_ds {
struct ipc_perm sem_perm;
__kernel_time_t sem_otime;
__kernel_time_t sem_ctime;
struct sem *sem_base;
struct sem_queue *sem_pending;
struct sem_queue **sem_pending_last;
struct sem_undo *undo;
unsigned short sem_nsems;
};
# 1 "../../include/asm/sembuf.h" 1
# 14 "../../include/asm/sembuf.h"
struct semid64_ds {
struct ipc64_perm sem_perm;
__kernel_time_t sem_otime;
unsigned long __unused1;
__kernel_time_t sem_ctime;
unsigned long __unused2;
unsigned long sem_nsems;
unsigned long __unused3;
unsigned long __unused4;
};
# 36 "../../include/linux/sem.h" 2
struct sembuf {
unsigned short sem_num;
short sem_op;
short sem_flg;
};
union semun {
int val;
struct semid_ds *buf;
unsigned short *array;
struct seminfo *__buf;
void *__pad;
};
struct seminfo {
int semmap;
int semmni;
int semmns;
int semmnu;
int semmsl;
int semopm;
int semume;
int semusz;
int semvmx;
int semaem;
};
# 26 "../../include/linux/sched.h" 2
# 1 "../../include/linux/signal.h" 1
# 1 "../../include/asm/signal.h" 1
# 1 "../../include/linux/types.h" 1
# 5 "../../include/asm/signal.h" 2
struct siginfo;
# 27 "../../include/asm/signal.h"
typedef unsigned long sigset_t;
# 129 "../../include/asm/signal.h"
typedef void (*__sighandler_t)(int);
# 156 "../../include/asm/signal.h"
struct sigaction {
union {
__sighandler_t _sa_handler;
void (*_sa_sigaction)(int, struct siginfo *, void *);
} _u;
sigset_t sa_mask;
unsigned long sa_flags;
void (*sa_restorer)(void);
};
typedef struct sigaltstack {
void *ss_sp;
int ss_flags;
size_t ss_size;
} stack_t;
# 5 "../../include/linux/signal.h" 2
# 1 "../../include/asm/siginfo.h" 1
# 1 "../../include/linux/types.h" 1
# 5 "../../include/asm/siginfo.h" 2
typedef union sigval {
int sival_int;
void *sival_ptr;
} sigval_t;
typedef struct siginfo {
int si_signo;
int si_errno;
int si_code;
union {
int _pad[((128/sizeof(int)) - 3)];
struct {
pid_t _pid;
uid_t _uid;
} _kill;
struct {
unsigned int _timer1;
unsigned int _timer2;
} _timer;
struct {
pid_t _pid;
uid_t _uid;
sigval_t _sigval;
} _rt;
struct {
pid_t _pid;
uid_t _uid;
int _status;
clock_t _utime;
clock_t _stime;
} _sigchld;
struct {
void *_addr;
} _sigfault;
struct {
int _band;
int _fd;
} _sigpoll;
} _sifields;
} siginfo_t;
# 199 "../../include/asm/siginfo.h"
typedef struct sigevent {
sigval_t sigev_value;
int sigev_signo;
int sigev_notify;
union {
int _pad[((64/sizeof(int)) - 3)];
struct {
void (*_function)(sigval_t);
void *_attribute;
} _sigev_thread;
} _sigev_un;
} sigevent_t;
# 6 "../../include/linux/signal.h" 2
# 27 "../../include/linux/sched.h" 2
# 1 "../../include/linux/securebits.h" 1
extern unsigned securebits;
# 28 "../../include/linux/sched.h" 2
# 1 "../../include/linux/fs_struct.h" 1
# 29 "../../include/linux/sched.h" 2
struct exec_domain;
# 58 "../../include/linux/sched.h"
extern unsigned long avenrun[];
# 75 "../../include/linux/sched.h"
extern int nr_running, nr_threads;
extern int last_pid;
# 1 "../../include/linux/fs.h" 1
# 79 "../../include/linux/sched.h" 2
# 1 "../../include/linux/time.h" 1
# 1 "../../include/asm/param.h" 1
# 5 "../../include/linux/time.h" 2
# 1 "../../include/linux/types.h" 1
# 6 "../../include/linux/time.h" 2
struct timespec {
time_t tv_sec;
long tv_nsec;
};
# 88 "../../include/linux/time.h"
struct timeval {
time_t tv_sec;
suseconds_t tv_usec;
};
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
# 121 "../../include/linux/time.h"
struct itimerspec {
struct timespec it_interval;
struct timespec it_value;
};
struct itimerval {
struct timeval it_interval;
struct timeval it_value;
};
# 80 "../../include/linux/sched.h" 2
# 1 "../../include/linux/param.h" 1
# 1 "../../include/asm/param.h" 1
# 5 "../../include/linux/param.h" 2
# 81 "../../include/linux/sched.h" 2
# 1 "../../include/linux/resource.h" 1
# 1 "../../include/linux/time.h" 1
# 5 "../../include/linux/resource.h" 2
# 21 "../../include/linux/resource.h"
struct rusage {
struct timeval ru_utime;
struct timeval ru_stime;
long ru_maxrss;
long ru_ixrss;
long ru_idrss;
long ru_isrss;
long ru_minflt;
long ru_majflt;
long ru_nswap;
long ru_inblock;
long ru_oublock;
long ru_msgsnd;
long ru_msgrcv;
long ru_nsignals;
long ru_nvcsw;
long ru_nivcsw;
};
struct rlimit {
unsigned long rlim_cur;
unsigned long rlim_max;
};
# 56 "../../include/linux/resource.h"
# 1 "../../include/asm/resource.h" 1
# 57 "../../include/linux/resource.h" 2
# 82 "../../include/linux/sched.h" 2
# 1 "../../include/linux/timer.h" 1
# 1 "../../include/linux/config.h" 1
# 5 "../../include/linux/timer.h" 2
# 1 "../../include/linux/list.h" 1
# 6 "../../include/linux/timer.h" 2
# 16 "../../include/linux/timer.h"
struct timer_list {
struct list_head list;
unsigned long expires;
unsigned long data;
void (*function)(unsigned long);
};
extern void add_timer(struct timer_list * timer);
extern int del_timer(struct timer_list * timer);
# 41 "../../include/linux/timer.h"
int mod_timer(struct timer_list *timer, unsigned long expires);
extern void it_real_fn(unsigned long);
static inline void init_timer(struct timer_list * timer)
{
timer->list.next = timer->list.prev = ((void *)0);
}
static inline int timer_pending (const struct timer_list * timer)
{
return timer->list.next != ((void *)0);
}
# 83 "../../include/linux/sched.h" 2
# 1 "../../include/asm/processor.h" 1
# 10 "../../include/asm/processor.h"
# 1 "../../include/asm/vm86.h" 1
# 68 "../../include/asm/vm86.h"
struct vm86_regs {
long ebx;
long ecx;
long edx;
long esi;
long edi;
long ebp;
long eax;
long __null_ds;
long __null_es;
long __null_fs;
long __null_gs;
long orig_eax;
long eip;
unsigned short cs, __csh;
long eflags;
long esp;
unsigned short ss, __ssh;
unsigned short es, __esh;
unsigned short ds, __dsh;
unsigned short fs, __fsh;
unsigned short gs, __gsh;
};
struct revectored_struct {
unsigned long __map[8];
};
struct vm86_struct {
struct vm86_regs regs;
unsigned long flags;
unsigned long screen_bitmap;
unsigned long cpu_type;
struct revectored_struct int_revectored;
struct revectored_struct int21_revectored;
};
struct vm86plus_info_struct {
unsigned long force_return_for_pic:1;
unsigned long vm86dbg_active:1;
unsigned long vm86dbg_TFpendig:1;
unsigned long unused:28;
unsigned long is_vm86pus:1;
unsigned char vm86dbg_intxxtab[32];
};
struct vm86plus_struct {
struct vm86_regs regs;
unsigned long flags;
unsigned long screen_bitmap;
unsigned long cpu_type;
struct revectored_struct int_revectored;
struct revectored_struct int21_revectored;
struct vm86plus_info_struct vm86plus;
};
# 11 "../../include/asm/processor.h" 2
# 1 "../../include/asm/math_emu.h" 1
# 1 "../../include/asm/sigcontext.h" 1
# 18 "../../include/asm/sigcontext.h"
struct _fpreg {
unsigned short significand[4];
unsigned short exponent;
};
struct _fpxreg {
unsigned short significand[4];
unsigned short exponent;
unsigned short padding[3];
};
struct _xmmreg {
unsigned long element[4];
};
struct _fpstate {
unsigned long cw;
unsigned long sw;
unsigned long tag;
unsigned long ipoff;
unsigned long cssel;
unsigned long dataoff;
unsigned long datasel;
struct _fpreg _st[8];
unsigned short status;
unsigned short magic;
unsigned long _fxsr_env[6];
unsigned long mxcsr;
unsigned long reserved;
struct _fpxreg _fxsr_st[8];
struct _xmmreg _xmm[8];
unsigned long padding[56];
};
struct sigcontext {
unsigned short gs, __gsh;
unsigned short fs, __fsh;
unsigned short es, __esh;
unsigned short ds, __dsh;
unsigned long edi;
unsigned long esi;
unsigned long ebp;
unsigned long esp;
unsigned long ebx;
unsigned long edx;
unsigned long ecx;
unsigned long eax;
unsigned long trapno;
unsigned long err;
unsigned long eip;
unsigned short cs, __csh;
unsigned long eflags;
unsigned long esp_at_signal;
unsigned short ss, __ssh;
struct _fpstate * fpstate;
unsigned long oldmask;
unsigned long cr2;
};
# 5 "../../include/asm/math_emu.h" 2
int restore_i387_soft(void *s387, struct _fpstate *buf);
int save_i387_soft(void *s387, struct _fpstate * buf);
struct info {
long ___orig_eip;
long ___ebx;
long ___ecx;
long ___edx;
long ___esi;
long ___edi;
long ___ebp;
long ___eax;
long ___ds;
long ___es;
long ___orig_eax;
long ___eip;
long ___cs;
long ___eflags;
long ___esp;
long ___ss;
long ___vm86_es;
long ___vm86_ds;
long ___vm86_fs;
long ___vm86_gs;
};
# 12 "../../include/asm/processor.h" 2
# 1 "../../include/asm/segment.h" 1
# 13 "../../include/asm/processor.h" 2
# 1 "../../include/asm/page.h" 1
# 14 "../../include/asm/processor.h" 2
# 1 "../../include/asm/types.h" 1
# 15 "../../include/asm/processor.h" 2
# 1 "../../include/asm/sigcontext.h" 1
# 16 "../../include/asm/processor.h" 2
# 1 "../../include/asm/cpufeature.h" 1
# 17 "../../include/asm/processor.h" 2
# 1 "../../include/linux/cache.h" 1
# 18 "../../include/asm/processor.h" 2
# 1 "../../include/linux/config.h" 1
# 19 "../../include/asm/processor.h" 2
# 1 "../../include/linux/threads.h" 1
# 20 "../../include/asm/processor.h" 2
# 33 "../../include/asm/processor.h"
struct cpuinfo_x86 {
__u8 x86;
__u8 x86_vendor;
__u8 x86_model;
__u8 x86_mask;
char wp_works_ok;
char hlt_works_ok;
char hard_math;
char rfu;
int cpuid_level;
__u32 x86_capability[4];
char x86_vendor_id[16];
char x86_model_id[64];
int x86_cache_size;
int fdiv_bug;
int f00f_bug;
int coma_bug;
unsigned long loops_per_jiffy;
unsigned long *pgd_quick;
unsigned long *pmd_quick;
unsigned long *pte_quick;
unsigned long pgtable_cache_sz;
} __attribute__((__aligned__((1 << ((5))))));
# 72 "../../include/asm/processor.h"
extern struct cpuinfo_x86 boot_cpu_data;
extern struct tss_struct init_tss[1];
# 94 "../../include/asm/processor.h"
extern char ignore_irq13;
extern void identify_cpu(struct cpuinfo_x86 *);
extern void print_cpu_info(struct cpuinfo_x86 *);
extern void dodgy_tsc(void);
# 124 "../../include/asm/processor.h"
static inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx)
{
__asm__("cpuid"
: "=a" (*eax),
"=b" (*ebx),
"=c" (*ecx),
"=d" (*edx)
: "0" (op));
}
static inline unsigned int cpuid_eax(unsigned int op)
{
unsigned int eax;
__asm__("cpuid"
: "=a" (eax)
: "0" (op)
: "bx", "cx", "dx");
return eax;
}
static inline unsigned int cpuid_ebx(unsigned int op)
{
unsigned int eax, ebx;
__asm__("cpuid"
: "=a" (eax), "=b" (ebx)
: "0" (op)
: "cx", "dx" );
return ebx;
}
static inline unsigned int cpuid_ecx(unsigned int op)
{
unsigned int eax, ecx;
__asm__("cpuid"
: "=a" (eax), "=c" (ecx)
: "0" (op)
: "bx", "dx" );
return ecx;
}
static inline unsigned int cpuid_edx(unsigned int op)
{
unsigned int eax, edx;
__asm__("cpuid"
: "=a" (eax), "=d" (edx)
: "0" (op)
: "bx", "cx");
return edx;
}
# 199 "../../include/asm/processor.h"
extern unsigned long mmu_cr4_features;
static inline void set_in_cr4 (unsigned long mask)
{
mmu_cr4_features |= mask;
__asm__("movl %%cr4,%%eax\n\t"
"orl %0,%%eax\n\t"
"movl %%eax,%%cr4\n"
: : "irg" (mask)
:"ax");
}
static inline void clear_in_cr4 (unsigned long mask)
{
mmu_cr4_features &= ~mask;
__asm__("movl %%cr4,%%eax\n\t"
"andl %0,%%eax\n\t"
"movl %%eax,%%cr4\n"
: : "irg" (~mask)
:"ax");
}
# 256 "../../include/asm/processor.h"
extern int MCA_bus;
extern unsigned int machine_id;
extern unsigned int machine_submodel_id;
extern unsigned int BIOS_revision;
extern unsigned int mca_pentium_flag;
# 282 "../../include/asm/processor.h"
struct i387_fsave_struct {
long cwd;
long swd;
long twd;
long fip;
long fcs;
long foo;
long fos;
long st_space[20];
long status;
};
struct i387_fxsave_struct {
unsigned short cwd;
unsigned short swd;
unsigned short twd;
unsigned short fop;
long fip;
long fcs;
long foo;
long fos;
long mxcsr;
long reserved;
long st_space[32];
long xmm_space[32];
long padding[56];
} __attribute__ ((aligned (16)));
struct i387_soft_struct {
long cwd;
long swd;
long twd;
long fip;
long fcs;
long foo;
long fos;
long st_space[20];
unsigned char ftop, changed, lookahead, no_update, rm, alimit;
struct info *info;
unsigned long entry_eip;
};
union i387_union {
struct i387_fsave_struct fsave;
struct i387_fxsave_struct fxsave;
struct i387_soft_struct soft;
};
typedef struct {
unsigned long seg;
} mm_segment_t;
struct tss_struct {
unsigned short back_link,__blh;
unsigned long esp0;
unsigned short ss0,__ss0h;
unsigned long esp1;
unsigned short ss1,__ss1h;
unsigned long esp2;
unsigned short ss2,__ss2h;
unsigned long __cr3;
unsigned long eip;
unsigned long eflags;
unsigned long eax,ecx,edx,ebx;
unsigned long esp;
unsigned long ebp;
unsigned long esi;
unsigned long edi;
unsigned short es, __esh;
unsigned short cs, __csh;
unsigned short ss, __ssh;
unsigned short ds, __dsh;
unsigned short fs, __fsh;
unsigned short gs, __gsh;
unsigned short ldt, __ldth;
unsigned short trace, bitmap;
unsigned long io_bitmap[32 +1];
unsigned long __cacheline_filler[5];
};
struct thread_struct {
unsigned long esp0;
unsigned long eip;
unsigned long esp;
unsigned long fs;
unsigned long gs;
unsigned long debugreg[8];
unsigned long cr2, trap_no, error_code;
union i387_union i387;
struct vm86_struct * vm86_info;
unsigned long screen_bitmap;
unsigned long v86flags, v86mask, v86mode, saved_esp0;
int ioperm;
unsigned long io_bitmap[32 +1];
};
# 424 "../../include/asm/processor.h"
struct task_struct;
struct mm_struct;
extern void release_thread(struct task_struct *);
extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
extern void copy_segments(struct task_struct *p, struct mm_struct * mm);
extern void release_segments(struct mm_struct * mm);
static inline unsigned long thread_saved_pc(struct thread_struct *t)
{
return ((unsigned long *)t->esp)[3];
}
unsigned long get_wchan(struct task_struct *p);
# 458 "../../include/asm/processor.h"
struct microcode {
unsigned int hdrver;
unsigned int rev;
unsigned int date;
unsigned int sig;
unsigned int cksum;
unsigned int ldrver;
unsigned int pf;
unsigned int reserved[5];
unsigned int bits[500];
};
static inline void rep_nop(void)
{
__asm__ __volatile__("rep;nop");
}
extern inline void prefetch(const void *x)
{
__asm__ __volatile__ ("prefetchnta (%0)" : : "r"(x));
}
# 85 "../../include/linux/sched.h" 2
# 125 "../../include/linux/sched.h"
struct sched_param {
int sched_priority;
};
struct completion;
# 9 "../../include/asm/uaccess.h" 2
# 1 "../../include/linux/prefetch.h" 1
# 13 "../../include/linux/prefetch.h"
# 1 "../../include/asm/processor.h" 1
# 14 "../../include/linux/prefetch.h" 2
# 1 "../../include/asm/cache.h" 1
# 15 "../../include/linux/prefetch.h" 2
# 48 "../../include/linux/prefetch.h"
static inline void prefetchw(const void *x) {;}
# 10 "../../include/asm/uaccess.h" 2
# 1 "../../include/asm/page.h" 1
# 11 "../../include/asm/uaccess.h" 2
# 35 "../../include/asm/uaccess.h"
extern int __verify_write(const void *, unsigned long);
# 62 "../../include/asm/uaccess.h"
static inline int verify_area(int type, const void * addr, unsigned long size)
{
return (({ unsigned long flag,sum; asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" :"=&r" (flag), "=r" (sum) :"1" (addr),"g" ((int)(size)),"g" (current->addr_limit.seg)); flag; }) == 0) ? 0 : -EFAULT;
}
# 81 "../../include/asm/uaccess.h"
struct exception_table_entry
{
unsigned long insn, fixup;
};
extern unsigned long search_exception_table(unsigned long);
# 105 "../../include/asm/uaccess.h"
extern void __get_user_1(void);
extern void __get_user_2(void);
extern void __get_user_4(void);
# 127 "../../include/asm/uaccess.h"
extern void __put_user_1(void);
extern void __put_user_2(void);
extern void __put_user_4(void);
extern void __put_user_8(void);
extern void __put_user_bad(void);
# 188 "../../include/asm/uaccess.h"
struct __large_struct { unsigned long buf[100]; };
# 220 "../../include/asm/uaccess.h"
extern long __get_user_bad(void);
# 308 "../../include/asm/uaccess.h"
static inline unsigned long
__generic_copy_from_user_nocheck(void *to, const void *from, unsigned long n)
{
do { int __d0, __d1; __asm__ __volatile__( "0: rep; movsl\n" " movl %3,%0\n" "1: rep; movsb\n" "2:\n" ".section .fixup,\"ax\"\n" "3: lea 0(%3,%0,4),%0\n" "4: pushl %0\n" " pushl %%eax\n" " xorl %%eax,%%eax\n" " rep; stosb\n" " popl %%eax\n" " popl %0\n" " jmp 2b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,3b\n" " .long 1b,4b\n" ".previous" : "=&c"(n), "=&D" (__d0), "=&S" (__d1) : "r"(n & 3), "0"(n / 4), "1"(to), "2"(from) : "memory"); } while (0);
return n;
}
static inline unsigned long
__generic_copy_to_user_nocheck(void *to, const void *from, unsigned long n)
{
do { int __d0, __d1; __asm__ __volatile__( "0: rep; movsl\n" " movl %3,%0\n" "1: rep; movsb\n" "2:\n" ".section .fixup,\"ax\"\n" "3: lea 0(%3,%0,4),%0\n" " jmp 2b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,3b\n" " .long 1b,2b\n" ".previous" : "=&c"(n), "=&D" (__d0), "=&S" (__d1) : "r"(n & 3), "0"(n / 4), "1"(to), "2"(from) : "memory"); } while (0);
return n;
}
# 543 "../../include/asm/uaccess.h"
unsigned long __generic_copy_to_user(void *, const void *, unsigned long);
unsigned long __generic_copy_from_user(void *, const void *, unsigned long);
static inline unsigned long
__constant_copy_to_user(void *to, const void *from, unsigned long n)
{
prefetch(from);
if ((({ unsigned long flag,sum; asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" :"=&r" (flag), "=r" (sum) :"1" (to),"g" ((int)(n)),"g" (current->addr_limit.seg)); flag; }) == 0))
do { int __d0, __d1; switch (n & 3) { default: __asm__ __volatile__( "0: rep; movsl\n" "1:\n" ".section .fixup,\"ax\"\n" "2: shl $2,%0\n" " jmp 1b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,2b\n" ".previous" : "=c"(n), "=&S" (__d0), "=&D" (__d1) : "1"(from), "2"(to), "0"(n/4) : "memory"); break; case 1: __asm__ __volatile__( "0: rep; movsl\n" "1: movsb\n" "2:\n" ".section .fixup,\"ax\"\n" "3: shl $2,%0\n" "4: incl %0\n" " jmp 2b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,3b\n" " .long 1b,4b\n" ".previous" : "=c"(n), "=&S" (__d0), "=&D" (__d1) : "1"(from), "2"(to), "0"(n/4) : "memory"); break; case 2: __asm__ __volatile__( "0: rep; movsl\n" "1: movsw\n" "2:\n" ".section .fixup,\"ax\"\n" "3: shl $2,%0\n" "4: addl $2,%0\n" " jmp 2b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,3b\n" " .long 1b,4b\n" ".previous" : "=c"(n), "=&S" (__d0), "=&D" (__d1) : "1"(from), "2"(to), "0"(n/4) !
: "memory"); break; case 3: __asm__ __volatile__( "0: rep; movsl\n" "1: movsw\n" "2: movsb\n" "3:\n" ".section .fixup,\"ax\"\n" "4: shl $2,%0\n" "5: addl $2,%0\n" "6: incl %0\n" " jmp 3b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,4b\n" " .long 1b,5b\n" " .long 2b,6b\n" ".previous" : "=c"(n), "=&S" (__d0), "=&D" (__d1) : "1"(from), "2"(to), "0"(n/4) : "memory"); break; } } while (0);
return n;
}
static inline unsigned long
__constant_copy_from_user(void *to, const void *from, unsigned long n)
{
if ((({ unsigned long flag,sum; asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" :"=&r" (flag), "=r" (sum) :"1" (from),"g" ((int)(n)),"g" (current->addr_limit.seg)); flag; }) == 0))
do { int __d0, __d1; switch (n & 3) { default: __asm__ __volatile__( "0: rep; movsl\n" "1:\n" ".section .fixup,\"ax\"\n" "2: pushl %0\n" " pushl %%eax\n" " xorl %%eax,%%eax\n" " rep; stosl\n" " popl %%eax\n" " popl %0\n" " shl $2,%0\n" " jmp 1b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,2b\n" ".previous" : "=c"(n), "=&S" (__d0), "=&D" (__d1) : "1"(from), "2"(to), "0"(n/4) : "memory"); break; case 1: __asm__ __volatile__( "0: rep; movsl\n" "1: movsb\n" "2:\n" ".section .fixup,\"ax\"\n" "3: pushl %0\n" " pushl %%eax\n" " xorl %%eax,%%eax\n" " rep; stosl\n" " stosb\n" " popl %%eax\n" " popl %0\n" " shl $2,%0\n" " incl %0\n" " jmp 2b\n" "4: pushl %%eax\n" " xorl %%eax,%%eax\n" " stosb\n" " popl %%eax\n" " incl %0\n" " jmp 2b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,3b\n" " .long 1b,4b\n" ".previous" : "=c"(n), "=&S" (__d0), "=&D" (__d1) : "1"(from), "2"(to), "0"(n/4) : "memory"); break; case 2: __asm__ _!
_volatile__( "0: rep; movsl\n" "1: movsw\n" "2:\n" ".section .fixup,\"ax\"\n" "3: pushl %0\n" " pushl %%eax\n" " xorl %%eax,%%eax\n" " rep; stosl\n" " stosw\n" " popl %%eax\n" " popl %0\n" " shl $2,%0\n" " addl $2,%0\n" " jmp 2b\n" "4: pushl %%eax\n" " xorl %%eax,%%eax\n" " stosw\n" " popl %%eax\n" " addl $2,%0\n" " jmp 2b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,3b\n" " .long 1b,4b\n" ".previous" : "=c"(n), "=&S" (__d0), "=&D" (__d1) : "1"(from), "2"(to), "0"(n/4) : "memory"); break; case 3: __asm__ __volatile__( "0: rep; movsl\n" "1: movsw\n" "2: movsb\n" "3:\n" ".section .fixup,\"ax\"\n" "4: pushl %0\n" " pushl %%eax\n" " xorl %%eax,%%eax\n" " rep; stosl\n" " stosw\n" " stosb\n" " popl %%eax\n" " popl %0\n" " shl $2,%0\n" " addl $3,%0\n" " jmp 2b\n" "5: pushl %%eax\n" " xorl %%eax,%%eax\n" " stosw\n" " stosb\n" " popl %%eax\n" " addl $3,%0\n" " jmp 2b\n" "6: pushl %%eax\n" " xorl %%eax,%%eax\n" " stosb\n" " popl %%eax\n" " incl %0\n" " jmp 3!
b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,4b\n" " .long 1b,5b\n" " .long 2b,6b\n" ".previous" : "=c"(n), "=&S" (__d0), "=&D" (__d1) : "1"(from), "2"(to), "0"(n/4) : "memory"); break; } } while (0);
else
memset(to, 0, n);
return n;
}
static inline unsigned long
__constant_copy_to_user_nocheck(void *to, const void *from, unsigned long n)
{
do { int __d0, __d1; switch (n & 3) { default: __asm__ __volatile__( "0: rep; movsl\n" "1:\n" ".section .fixup,\"ax\"\n" "2: shl $2,%0\n" " jmp 1b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,2b\n" ".previous" : "=c"(n), "=&S" (__d0), "=&D" (__d1) : "1"(from), "2"(to), "0"(n/4) : "memory"); break; case 1: __asm__ __volatile__( "0: rep; movsl\n" "1: movsb\n" "2:\n" ".section .fixup,\"ax\"\n" "3: shl $2,%0\n" "4: incl %0\n" " jmp 2b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,3b\n" " .long 1b,4b\n" ".previous" : "=c"(n), "=&S" (__d0), "=&D" (__d1) : "1"(from), "2"(to), "0"(n/4) : "memory"); break; case 2: __asm__ __volatile__( "0: rep; movsl\n" "1: movsw\n" "2:\n" ".section .fixup,\"ax\"\n" "3: shl $2,%0\n" "4: addl $2,%0\n" " jmp 2b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,3b\n" " .long 1b,4b\n" ".previous" : "=c"(n), "=&S" (__d0), "=&D" (__d1) : "1"(from), "2"(to), "0"(n/4) : "memor!
y"); break; case 3: __asm__ __volatile__( "0: rep; movsl\n" "1: movsw\n" "2: movsb\n" "3:\n" ".section .fixup,\"ax\"\n" "4: shl $2,%0\n" "5: addl $2,%0\n" "6: incl %0\n" " jmp 3b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,4b\n" " .long 1b,5b\n" " .long 2b,6b\n" ".previous" : "=c"(n), "=&S" (__d0), "=&D" (__d1) : "1"(from), "2"(to), "0"(n/4) : "memory"); break; } } while (0);
return n;
}
static inline unsigned long
__constant_copy_from_user_nocheck(void *to, const void *from, unsigned long n)
{
do { int __d0, __d1; switch (n & 3) { default: __asm__ __volatile__( "0: rep; movsl\n" "1:\n" ".section .fixup,\"ax\"\n" "2: pushl %0\n" " pushl %%eax\n" " xorl %%eax,%%eax\n" " rep; stosl\n" " popl %%eax\n" " popl %0\n" " shl $2,%0\n" " jmp 1b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,2b\n" ".previous" : "=c"(n), "=&S" (__d0), "=&D" (__d1) : "1"(from), "2"(to), "0"(n/4) : "memory"); break; case 1: __asm__ __volatile__( "0: rep; movsl\n" "1: movsb\n" "2:\n" ".section .fixup,\"ax\"\n" "3: pushl %0\n" " pushl %%eax\n" " xorl %%eax,%%eax\n" " rep; stosl\n" " stosb\n" " popl %%eax\n" " popl %0\n" " shl $2,%0\n" " incl %0\n" " jmp 2b\n" "4: pushl %%eax\n" " xorl %%eax,%%eax\n" " stosb\n" " popl %%eax\n" " incl %0\n" " jmp 2b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,3b\n" " .long 1b,4b\n" ".previous" : "=c"(n), "=&S" (__d0), "=&D" (__d1) : "1"(from), "2"(to), "0"(n/4) : "memory"); break; case 2: __asm__ __volatil!
e__( "0: rep; movsl\n" "1: movsw\n" "2:\n" ".section .fixup,\"ax\"\n" "3: pushl %0\n" " pushl %%eax\n" " xorl %%eax,%%eax\n" " rep; stosl\n" " stosw\n" " popl %%eax\n" " popl %0\n" " shl $2,%0\n" " addl $2,%0\n" " jmp 2b\n" "4: pushl %%eax\n" " xorl %%eax,%%eax\n" " stosw\n" " popl %%eax\n" " addl $2,%0\n" " jmp 2b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,3b\n" " .long 1b,4b\n" ".previous" : "=c"(n), "=&S" (__d0), "=&D" (__d1) : "1"(from), "2"(to), "0"(n/4) : "memory"); break; case 3: __asm__ __volatile__( "0: rep; movsl\n" "1: movsw\n" "2: movsb\n" "3:\n" ".section .fixup,\"ax\"\n" "4: pushl %0\n" " pushl %%eax\n" " xorl %%eax,%%eax\n" " rep; stosl\n" " stosw\n" " stosb\n" " popl %%eax\n" " popl %0\n" " shl $2,%0\n" " addl $3,%0\n" " jmp 2b\n" "5: pushl %%eax\n" " xorl %%eax,%%eax\n" " stosw\n" " stosb\n" " popl %%eax\n" " addl $3,%0\n" " jmp 2b\n" "6: pushl %%eax\n" " xorl %%eax,%%eax\n" " stosb\n" " popl %%eax\n" " incl %0\n" " jmp 3b\n" ".p!
revious\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 0b,4b\n" " .long 1b,5b\n" " .long 2b,6b\n" ".previous" : "=c"(n), "=&S" (__d0), "=&D" (__d1) : "1"(from), "2"(to), "0"(n/4) : "memory"); break; } } while (0);
return n;
}
# 599 "../../include/asm/uaccess.h"
long strncpy_from_user(char *dst, const char *src, long count);
long __strncpy_from_user(char *dst, const char *src, long count);
long strnlen_user(const char *str, long n);
unsigned long clear_user(void *mem, unsigned long len);
unsigned long __clear_user(void *mem, unsigned long len);
# 160 "8139too.c" 2
# 198 "8139too.c"
static int media[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
static int full_duplex[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
static int max_interrupt_work = 20;
static int multicast_filter_limit = 32;
# 241 "8139too.c"
enum {
HAS_MII_XCVR = 0x010000,
HAS_CHIP_XCVR = 0x020000,
HAS_LNK_CHNG = 0x040000,
};
typedef enum {
RTL8139 = 0,
RTL8139_CB,
SMC1211TX,
DELTA8139,
ADDTRON8139,
DFE538TX,
DFE690TXD,
RTL8129,
} board_t;
static struct {
const char *name;
u32 hw_flags;
} board_info[] = {
{ "RealTek RTL8139 Fast Ethernet", HAS_CHIP_XCVR|HAS_LNK_CHNG },
{ "RealTek RTL8139B PCI/CardBus", HAS_CHIP_XCVR|HAS_LNK_CHNG },
{ "SMC1211TX EZCard 10/100 (RealTek RTL8139)", HAS_CHIP_XCVR|HAS_LNK_CHNG },
{ "Delta Electronics 8139 10/100BaseTX", HAS_CHIP_XCVR|HAS_LNK_CHNG },
{ "Addtron Technolgy 8139 10/100BaseTX", HAS_CHIP_XCVR|HAS_LNK_CHNG },
{ "D-Link DFE-538TX (RealTek RTL8139)", HAS_CHIP_XCVR|HAS_LNK_CHNG },
{ "D-Link DFE-690TXD (RealTek RTL8139)", HAS_CHIP_XCVR|HAS_LNK_CHNG },
{ "RealTek RTL8129", HAS_MII_XCVR },
};
static struct pci_device_id rtl8139_pci_tbl[] = {
{0x10ec, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
{0x10ec, 0x8138, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139_CB },
{0x1113, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SMC1211TX },
{0x1500, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DELTA8139 },
{0x4033, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ADDTRON8139 },
{0x1186, 0x1300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DFE538TX },
{0x1186, 0x1340, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DFE690TXD },
# 301 "8139too.c"
{PCI_ANY_ID, 0x8139, 0x10ec, 0x8139, 0, 0, RTL8139 },
{PCI_ANY_ID, 0x8139, 0x1186, 0x1300, 0, 0, DFE538TX },
{0,}
};
;
enum RTL8139_registers {
MAC0 = 0,
MAR0 = 8,
TxStatus0 = 0x10,
TxAddr0 = 0x20,
RxBuf = 0x30,
RxEarlyCnt = 0x34,
RxEarlyStatus = 0x36,
ChipCmd = 0x37,
RxBufPtr = 0x38,
RxBufAddr = 0x3A,
IntrMask = 0x3C,
IntrStatus = 0x3E,
TxConfig = 0x40,
ChipVersion = 0x43,
RxConfig = 0x44,
Timer = 0x48,
RxMissed = 0x4C,
Cfg9346 = 0x50,
Config0 = 0x51,
Config1 = 0x52,
FlashReg = 0x54,
MediaStatus = 0x58,
Config3 = 0x59,
Config4 = 0x5A,
HltClk = 0x5B,
MultiIntr = 0x5C,
TxSummary = 0x60,
BasicModeCtrl = 0x62,
BasicModeStatus = 0x64,
NWayAdvert = 0x66,
NWayLPAR = 0x68,
NWayExpansion = 0x6A,
FIFOTMS = 0x70,
CSCR = 0x74,
PARA78 = 0x78,
PARA7c = 0x7c,
Config5 = 0xD8,
};
enum ClearBitMasks {
MultiIntrClear = 0xF000,
ChipCmdClear = 0xE2,
Config1Clear = (1<<7)|(1<<6)|(1<<3)|(1<<2)|(1<<1),
};
enum ChipCmdBits {
CmdReset = 0x10,
CmdRxEnb = 0x08,
CmdTxEnb = 0x04,
RxBufEmpty = 0x01,
};
enum IntrStatusBits {
PCIErr = 0x8000,
PCSTimeout = 0x4000,
RxFIFOOver = 0x40,
RxUnderrun = 0x20,
RxOverflow = 0x10,
TxErr = 0x08,
TxOK = 0x04,
RxErr = 0x02,
RxOK = 0x01,
RxAckBits = RxFIFOOver | RxOverflow | RxOK,
};
enum TxStatusBits {
TxHostOwns = 0x2000,
TxUnderrun = 0x4000,
TxStatOK = 0x8000,
TxOutOfWindow = 0x20000000,
TxAborted = 0x40000000,
TxCarrierLost = 0x80000000,
};
enum RxStatusBits {
RxMulticast = 0x8000,
RxPhysical = 0x4000,
RxBroadcast = 0x2000,
RxBadSymbol = 0x0020,
RxRunt = 0x0010,
RxTooLong = 0x0008,
RxCRCErr = 0x0004,
RxBadAlign = 0x0002,
RxStatusOK = 0x0001,
};
enum rx_mode_bits {
AcceptErr = 0x20,
AcceptRunt = 0x10,
AcceptBroadcast = 0x08,
AcceptMulticast = 0x04,
AcceptMyPhys = 0x02,
AcceptAllPhys = 0x01,
};
enum tx_config_bits {
TxIFG1 = (1 << 25),
TxIFG0 = (1 << 24),
TxLoopBack = (1 << 18) | (1 << 17),
TxCRC = (1 << 16),
TxClearAbt = (1 << 0),
TxDMAShift = 8,
TxVersionMask = 0x7C800000,
};
enum Config1Bits {
Cfg1_PM_Enable = 0x01,
Cfg1_VPD_Enable = 0x02,
Cfg1_PIO = 0x04,
Cfg1_MMIO = 0x08,
LWAKE = 0x10,
Cfg1_Driver_Load = 0x20,
Cfg1_LED0 = 0x40,
Cfg1_LED1 = 0x80,
SLEEP = (1 << 1),
PWRDN = (1 << 0),
};
enum Config3Bits {
Cfg3_FBtBEn = (1 << 0),
Cfg3_FuncRegEn = (1 << 1),
Cfg3_CLKRUN_En = (1 << 2),
Cfg3_CardB_En = (1 << 3),
Cfg3_LinkUp = (1 << 4),
Cfg3_Magic = (1 << 5),
Cfg3_PARM_En = (1 << 6),
Cfg3_GNTSel = (1 << 7),
};
enum Config4Bits {
LWPTN = (1 << 2),
};
enum Config5Bits {
Cfg5_PME_STS = (1 << 0),
Cfg5_LANWake = (1 << 1),
Cfg5_LDPS = (1 << 2),
Cfg5_FIFOAddrPtr = (1 << 3),
Cfg5_UWF = (1 << 4),
Cfg5_MWF = (1 << 5),
Cfg5_BWF = (1 << 6),
};
enum RxConfigBits {
RxCfgEarlyRxNone = 0,
RxCfgEarlyRxShift = 24,
RxCfgFIFOShift = 13,
RxCfgFIFONone = (7 << RxCfgFIFOShift),
RxCfgDMAShift = 8,
RxCfgDMAUnlimited = (7 << RxCfgDMAShift),
RxCfgRcv8K = 0,
RxCfgRcv16K = (1 << 11),
RxCfgRcv32K = (1 << 12),
RxCfgRcv64K = (1 << 11) | (1 << 12),
RxNoWrap = (1 << 7),
};
enum CSCRBits {
CSCR_LinkOKBit = 0x0400,
CSCR_LinkChangeBit = 0x0800,
CSCR_LinkStatusBits = 0x0f000,
CSCR_LinkDownOffCmd = 0x003c0,
CSCR_LinkDownCmd = 0x0f3c0,
};
enum Cfg9346Bits {
Cfg9346_Lock = 0x00,
Cfg9346_Unlock = 0xC0,
};
static const unsigned long param[4][4] = {
{0xcb39de43, 0xcb39ce43, 0xfb38de03, 0xcb38de43},
{0xcb39de43, 0xcb39ce43, 0xcb39ce83, 0xcb39ce83},
{0xcb39de43, 0xcb39ce43, 0xcb39ce83, 0xcb39ce83},
{0xbb39de43, 0xbb39ce43, 0xbb39ce83, 0xbb39ce83}
};
struct ring_info {
struct sk_buff *skb;
dma_addr_t mapping;
};
typedef enum {
CH_8139 = 0,
CH_8139_K,
CH_8139A,
CH_8139B,
CH_8130,
CH_8139C,
} chip_t;
enum chip_flags {
HasHltClk = (1 << 0),
HasLWake = (1 << 1),
};
const static struct {
const char *name;
u8 version;
u32 RxConfigMask;
u32 flags;
} rtl_chip_info[] = {
{ "RTL-8139",
0x40,
0xf0fe0040,
HasHltClk,
},
{ "RTL-8139 rev K",
0x60,
0xf0fe0040,
HasHltClk,
},
{ "RTL-8139A",
0x70,
0xf0fe0040,
HasHltClk,
},
{ "RTL-8139B",
0x78,
0xf0fc0040,
HasLWake,
},
{ "RTL-8130",
0x7C,
0xf0fe0040,
HasLWake,
},
{ "RTL-8139C",
0x74,
0xf0fc0040,
HasLWake,
},
};
struct rtl_extra_stats {
unsigned long early_rx;
unsigned long tx_buf_mapped;
unsigned long tx_timeouts;
};
struct rtl8139_private {
void *mmio_addr;
int drv_flags;
struct pci_dev *pci_dev;
struct net_device_stats stats;
unsigned char *rx_ring;
unsigned int cur_rx;
unsigned int tx_flag;
unsigned long cur_tx;
unsigned long dirty_tx;
struct ring_info tx_info[4];
unsigned char *tx_buf[4];
unsigned char *tx_bufs;
dma_addr_t rx_ring_dma;
dma_addr_t tx_bufs_dma;
signed char phys[4];
char twistie, twist_row, twist_col;
unsigned int full_duplex:1;
unsigned int duplex_lock:1;
unsigned int default_port:4;
unsigned int media2:4;
unsigned int medialock:1;
unsigned int mediasense:1;
spinlock_t lock;
chip_t chipset;
pid_t thr_pid;
wait_queue_head_t thr_wait;
struct completion thr_exited;
u32 rx_config;
struct rtl_extra_stats xstats;
};
;
;
;
;
;
;
;
;
;
;
;
static int read_eeprom (void *ioaddr, int location, int addr_len);
static int rtl8139_open (struct net_device *dev);
static int mdio_read (struct net_device *dev, int phy_id, int location);
static void mdio_write (struct net_device *dev, int phy_id, int location,
int val);
static int rtl8139_thread (void *data);
static void rtl8139_tx_timeout (struct net_device *dev);
static void rtl8139_init_ring (struct net_device *dev);
static int rtl8139_start_xmit (struct sk_buff *skb,
struct net_device *dev);
static void rtl8139_interrupt (int irq, void *dev_instance,
struct pt_regs *regs);
static int rtl8139_close (struct net_device *dev);
static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd);
static struct net_device_stats *rtl8139_get_stats (struct net_device *dev);
static inline u32 ether_crc (int length, unsigned char *data);
static void rtl8139_set_rx_mode (struct net_device *dev);
static void __set_rx_mode (struct net_device *dev);
static void rtl8139_hw_start (struct net_device *dev);
# 712 "8139too.c"
static const u16 rtl8139_intr_mask =
PCIErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver |
TxErr | TxOK | RxErr | RxOK;
static const unsigned int rtl8139_rx_config =
(14 << RxCfgEarlyRxShift) | RxCfgRcv32K | RxNoWrap |
(7 << RxCfgFIFOShift) |
(7 << RxCfgDMAShift);
static void __rtl8139_cleanup_dev (struct net_device *dev)
{
struct rtl8139_private *tp;
struct pci_dev *pdev;
if(!(dev != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "dev != NULL","8139too.c",__FUNCTION__,727); };
if(!(dev->priv != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "dev->priv != NULL","8139too.c",__FUNCTION__,728); };
tp = dev->priv;
if(!(tp->pci_dev != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "tp->pci_dev != NULL","8139too.c",__FUNCTION__,731); };
pdev = tp->pci_dev;
if (tp->mmio_addr)
iounmap (tp->mmio_addr);
pci_release_regions (pdev);
memset (dev, 0xBC,
sizeof (struct net_device) +
sizeof (struct rtl8139_private));
kfree (dev);
pci_set_drvdata (pdev, ((void *)0));
}
static void rtl8139_chip_reset (void *ioaddr)
{
int i;
writeb ((CmdReset), ioaddr + (ChipCmd));
for (i = 1000; i > 0; i--) {
barrier();
if ((readb (ioaddr + (ChipCmd)) & CmdReset) == 0)
break;
(__builtin_constant_p(10) ? ((10) > 20000 ? __bad_udelay() : __const_udelay((10) * 0x10c6ul)) : __udelay(10));
}
}
static int rtl8139_init_board (struct pci_dev *pdev,
struct net_device **dev_out)
{
void *ioaddr;
struct net_device *dev;
struct rtl8139_private *tp;
u8 tmp8;
int rc;
unsigned int i;
u32 pio_start, pio_end, pio_flags, pio_len;
unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
u32 tmp;
;
if(!(pdev != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "pdev != NULL","8139too.c",__FUNCTION__,787); };
*dev_out = ((void *)0);
dev = alloc_etherdev (sizeof (*tp));
if (dev == ((void *)0)) {
printk (KERN_ERR "8139too" ": " "%s: Unable to alloc new net device\n", pdev->slot_name);
;
return -ENOMEM;
}
do { } while (0);
tp = dev->priv;
tp->pci_dev = pdev;
rc = pci_enable_device (pdev);
if (rc)
goto err_out;
pio_start = pci_resource_start (pdev, 0);
pio_end = pci_resource_end (pdev, 0);
pio_flags = pci_resource_flags (pdev, 0);
pio_len = pci_resource_len (pdev, 0);
mmio_start = pci_resource_start (pdev, 1);
mmio_end = pci_resource_end (pdev, 1);
mmio_flags = pci_resource_flags (pdev, 1);
mmio_len = pci_resource_len (pdev, 1);
;
;
# 837 "8139too.c"
if (!(mmio_flags & 0x00000200)) {
printk (KERN_ERR "8139too" ": " "%s: region #1 not an MMIO resource, aborting\n", pdev->slot_name);
rc = -ENODEV;
goto err_out;
}
if (mmio_len < 0x80) {
printk (KERN_ERR "8139too" ": " "%s: Invalid PCI mem region size(s), aborting\n", pdev->slot_name);
rc = -ENODEV;
goto err_out;
}
rc = pci_request_regions (pdev, "8139too");
if (rc)
goto err_out;
pci_set_master (pdev);
ioaddr = ioremap (mmio_start, mmio_len);
if (ioaddr == ((void *)0)) {
printk (KERN_ERR "8139too" ": " "%s: cannot remap MMIO, aborting\n", pdev->slot_name);
rc = -EIO;
goto err_out;
}
dev->base_addr = (long) ioaddr;
tp->mmio_addr = ioaddr;
writeb (('R'), ioaddr + (HltClk));
if (((unsigned long) readl (ioaddr + (TxConfig))) == 0xFFFFFFFF) {
printk (KERN_ERR "8139too" ": " "%s: Chip not responding, ignoring board\n",
pdev->slot_name);
rc = -EIO;
goto err_out;
}
tmp = readb (ioaddr + (ChipVersion));
for (i = 0; i < ARRAY_SIZE (rtl_chip_info); i++)
if (tmp == rtl_chip_info[i].version) {
tp->chipset = i;
goto match;
}
printk (KERN_DEBUG "8139too" ": " "%s: unknown chip version, assuming RTL-8139\n",
pdev->slot_name);
printk (KERN_DEBUG "8139too" ": " "%s: TxConfig = 0x%lx\n", pdev->slot_name, ((unsigned long) readl (ioaddr + (TxConfig))));
tp->chipset = 0;
match:
;
if (tp->chipset >= CH_8139B) {
u8 new_tmp8 = tmp8 = readb (ioaddr + (Config1));
;
if ((rtl_chip_info[tp->chipset].flags & HasLWake) &&
(tmp8 & LWAKE))
new_tmp8 &= ~LWAKE;
new_tmp8 |= Cfg1_PM_Enable;
if (new_tmp8 != tmp8) {
writeb ((Cfg9346_Unlock), ioaddr + (Cfg9346));
writeb ((tmp8), ioaddr + (Config1));
writeb ((Cfg9346_Lock), ioaddr + (Cfg9346));
}
if (rtl_chip_info[tp->chipset].flags & HasLWake) {
tmp8 = readb (ioaddr + (Config4));
if (tmp8 & LWPTN)
writeb ((tmp8 & ~LWPTN), ioaddr + (Config4));
}
} else {
;
tmp8 = readb (ioaddr + (Config1));
tmp8 &= ~(SLEEP | PWRDN);
writeb ((tmp8), ioaddr + (Config1));
}
rtl8139_chip_reset (ioaddr);
;
*dev_out = dev;
return 0;
err_out:
__rtl8139_cleanup_dev (dev);
;
return rc;
}
static int rtl8139_init_one (struct pci_dev *pdev,
const struct pci_device_id *ent)
{
struct net_device *dev = ((void *)0);
struct rtl8139_private *tp;
int i, addr_len, option;
void *ioaddr;
static int board_idx = -1;
u8 pci_rev;
;
if(!(pdev != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "pdev != NULL","8139too.c",__FUNCTION__,952); };
if(!(ent != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "ent != NULL","8139too.c",__FUNCTION__,953); };
board_idx++;
{
static int printed_version;
if (!printed_version++)
printk (KERN_INFO "8139too" " Fast Ethernet driver " "0.9.20" "\n");
}
pci_read_config_byte(pdev, 0x08, &pci_rev);
if (pdev->vendor == 0x10ec &&
pdev->device == 0x8139 && pci_rev >= 0x20) {
printk(KERN_INFO "8139too" ": " "pci dev %s (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n",
pdev->slot_name, pdev->vendor, pdev->device, pci_rev);
printk(KERN_INFO "8139too" ": " "Use the \"8139cp\" driver for improved performance and stability.\n");
}
i = rtl8139_init_board (pdev, &dev);
if (i < 0) {
;
return i;
}
tp = dev->priv;
ioaddr = tp->mmio_addr;
if(!(ioaddr != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "ioaddr != NULL","8139too.c",__FUNCTION__,986); };
if(!(dev != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "dev != NULL","8139too.c",__FUNCTION__,987); };
if(!(tp != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "tp != NULL","8139too.c",__FUNCTION__,988); };
addr_len = read_eeprom (ioaddr, 0, 8) == 0x8129 ? 8 : 6;
for (i = 0; i < 3; i++)
((u16 *) (dev->dev_addr))[i] =
le16_to_cpu (read_eeprom (ioaddr, i + 7, addr_len));
dev->open = rtl8139_open;
dev->hard_start_xmit = rtl8139_start_xmit;
dev->stop = rtl8139_close;
dev->get_stats = rtl8139_get_stats;
dev->set_multicast_list = rtl8139_set_rx_mode;
dev->do_ioctl = netdev_ioctl;
dev->tx_timeout = rtl8139_tx_timeout;
dev->watchdog_timeo = (6*100);
dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM;
dev->irq = pdev->irq;
tp = dev->priv;
tp->drv_flags = board_info[ent->driver_data].hw_flags;
tp->mmio_addr = ioaddr;
do { } while(0);
init_waitqueue_head (&tp->thr_wait);
init_completion (&tp->thr_exited);
;
i = register_netdev (dev);
if (i) goto err_out;
pci_set_drvdata (pdev, dev);
printk (KERN_INFO "%s: %s at 0x%lx, "
"%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, "
"IRQ %d\n",
dev->name,
board_info[ent->driver_data].name,
dev->base_addr,
dev->dev_addr[0], dev->dev_addr[1],
dev->dev_addr[2], dev->dev_addr[3],
dev->dev_addr[4], dev->dev_addr[5],
dev->irq);
printk (KERN_DEBUG "%s: Identified 8139 chip type '%s'\n",
dev->name, rtl_chip_info[tp->chipset].name);
# 1063 "8139too.c"
tp->phys[0] = 32;
option = (board_idx >= 8) ? 0 : media[board_idx];
if (option > 0) {
tp->full_duplex = (option & 0x210) ? 1 : 0;
tp->default_port = option & 0xFF;
if (tp->default_port)
tp->medialock = 1;
}
if (board_idx < 8 && full_duplex[board_idx] > 0)
tp->full_duplex = full_duplex[board_idx];
if (tp->full_duplex) {
printk(KERN_INFO "%s: Media type forced to Full Duplex.\n", dev->name);
tp->duplex_lock = 1;
}
if (tp->default_port) {
printk(KERN_INFO " Forcing %dMbps %s-duplex operation.\n",
(option & 0x20 ? 100 : 10),
(option & 0x10 ? "full" : "half"));
mdio_write(dev, tp->phys[0], 0,
((option & 0x20) ? 0x2000 : 0) |
((option & 0x10) ? 0x0100 : 0));
}
if (rtl_chip_info[tp->chipset].flags & HasHltClk)
writeb (('H'), ioaddr + (HltClk));
;
return 0;
err_out:
__rtl8139_cleanup_dev (dev);
;
return i;
}
static void rtl8139_remove_one (struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata (pdev);
struct rtl8139_private *np;
;
if(!(dev != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "dev != NULL","8139too.c",__FUNCTION__,1111); };
np = dev->priv;
if(!(np != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "np != NULL","8139too.c",__FUNCTION__,1113); };
unregister_netdev (dev);
__rtl8139_cleanup_dev (dev);
;
}
# 1145 "8139too.c"
static int read_eeprom (void *ioaddr, int location, int addr_len)
{
int i;
unsigned retval = 0;
void *ee_addr = ioaddr + Cfg9346;
int read_cmd = location | ((6) << addr_len);
;
writeb ((0x80 | 0x08) & ~0x08, ee_addr);
writeb ((0x80 | 0x08), ee_addr);
readl(ee_addr);
for (i = 4 + addr_len; i >= 0; i--) {
int dataval = (read_cmd & (1 << i)) ? 0x02 : 0;
writeb ((0x80 | 0x08) | dataval, ee_addr);
readl(ee_addr);
writeb ((0x80 | 0x08) | dataval | 0x04, ee_addr);
readl(ee_addr);
}
writeb ((0x80 | 0x08), ee_addr);
readl(ee_addr);
for (i = 16; i > 0; i--) {
writeb ((0x80 | 0x08) | 0x04, ee_addr);
readl(ee_addr);
retval =
(retval << 1) | ((readb (ee_addr) & 0x01) ? 1 :
0);
writeb ((0x80 | 0x08), ee_addr);
readl(ee_addr);
}
writeb (~0x08, ee_addr);
readl(ee_addr);
;
return retval;
}
# 1203 "8139too.c"
static char mii_2_8139_map[8] = {
BasicModeCtrl,
BasicModeStatus,
0,
0,
NWayAdvert,
NWayLPAR,
NWayExpansion,
0
};
# 1234 "8139too.c"
static int mdio_read (struct net_device *dev, int phy_id, int location)
{
struct rtl8139_private *tp = dev->priv;
int retval = 0;
;
if (phy_id > 31) {
;
return location < 8 && mii_2_8139_map[location] ?
readw (tp->mmio_addr + mii_2_8139_map[location]) : 0;
}
# 1274 "8139too.c"
;
return (retval >> 1) & 0xffff;
}
static void mdio_write (struct net_device *dev, int phy_id, int location,
int value)
{
struct rtl8139_private *tp = dev->priv;
;
if (phy_id > 31) {
void *ioaddr = tp->mmio_addr;
if (location == 0) {
writeb ((Cfg9346_Unlock), ioaddr + (Cfg9346));
writew ((value), ioaddr + (BasicModeCtrl));
writeb ((Cfg9346_Lock), ioaddr + (Cfg9346));
} else if (location < 8 && mii_2_8139_map[location])
writew ((value), ioaddr + (mii_2_8139_map[location]));
return;
}
# 1322 "8139too.c"
}
static int rtl8139_open (struct net_device *dev)
{
struct rtl8139_private *tp = dev->priv;
int retval;
;
retval = request_irq (dev->irq, rtl8139_interrupt, SA_SHIRQ, dev->name, dev);
if (retval) {
;
return retval;
}
tp->tx_bufs = pci_alloc_consistent(tp->pci_dev, (1536 * 4),
&tp->tx_bufs_dma);
tp->rx_ring = pci_alloc_consistent(tp->pci_dev, ((8192 << 2) + 16 + 2048),
&tp->rx_ring_dma);
if (tp->tx_bufs == ((void *)0) || tp->rx_ring == ((void *)0)) {
free_irq(dev->irq, dev);
if (tp->tx_bufs)
pci_free_consistent(tp->pci_dev, (1536 * 4),
tp->tx_bufs, tp->tx_bufs_dma);
if (tp->rx_ring)
pci_free_consistent(tp->pci_dev, ((8192 << 2) + 16 + 2048),
tp->rx_ring, tp->rx_ring_dma);
;
return -ENOMEM;
}
tp->full_duplex = tp->duplex_lock;
tp->tx_flag = (256 << 11) & 0x003f0000;
tp->twistie = 1;
rtl8139_init_ring (dev);
rtl8139_hw_start (dev);
;
tp->thr_pid = kernel_thread (rtl8139_thread, dev, 0x00000200 | 0x00000400);
if (tp->thr_pid < 0)
printk (KERN_WARNING "%s: unable to start kernel thread\n",
dev->name);
;
return 0;
}
static void rtl_check_media (struct net_device *dev)
{
struct rtl8139_private *tp = dev->priv;
;
if (tp->phys[0] >= 0) {
u16 mii_reg5 = mdio_read(dev, tp->phys[0], 5);
if (mii_reg5 == 0xffff)
;
else if ((mii_reg5 & 0x0100) == 0x0100
|| (mii_reg5 & 0x00C0) == 0x0040)
tp->full_duplex = 1;
printk (KERN_INFO"%s: Setting %s%s-duplex based on"
" auto-negotiated partner ability %4.4x.\n",
dev->name, mii_reg5 == 0 ? "" :
(mii_reg5 & 0x0180) ? "100mbps " : "10mbps ",
tp->full_duplex ? "full" : "half", mii_reg5);
}
}
static void rtl8139_hw_start (struct net_device *dev)
{
struct rtl8139_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr;
u32 i;
u8 tmp;
;
if (rtl_chip_info[tp->chipset].flags & HasHltClk)
writeb (('R'), ioaddr + (HltClk));
rtl8139_chip_reset (ioaddr);
do { writeb ((Cfg9346_Unlock), ioaddr + (Cfg9346)); readb (ioaddr + (Cfg9346)); } while (0);
do { writel ((cpu_to_le32 (*(u32 *) (dev->dev_addr + 0))), ioaddr + (MAC0 + 0)); readl (ioaddr + (MAC0 + 0)); } while (0);
do { writel ((cpu_to_le32 (*(u32 *) (dev->dev_addr + 4))), ioaddr + (MAC0 + 4)); readl (ioaddr + (MAC0 + 4)); } while (0);
writeb ((CmdRxEnb | CmdTxEnb), ioaddr + (ChipCmd));
tp->rx_config = rtl8139_rx_config | AcceptBroadcast | AcceptMyPhys;
writel ((tp->rx_config), ioaddr + (RxConfig));
writel (((6 << TxDMAShift)), ioaddr + (TxConfig));
tp->cur_rx = 0;
rtl_check_media (dev);
if (tp->chipset >= CH_8139B) {
writeb ((readb (ioaddr + (Config3)) & ~Cfg3_Magic), ioaddr + (Config3));
}
;
writeb ((Cfg9346_Lock), ioaddr + (Cfg9346));
do { writel ((tp->rx_ring_dma), ioaddr + (RxBuf)); readl (ioaddr + (RxBuf)); } while (0);
for (i = 0; i < 4; i++)
do { writel ((tp->tx_bufs_dma + (tp->tx_buf[i] - tp->tx_bufs)), ioaddr + (TxAddr0 + (i * 4))); readl (ioaddr + (TxAddr0 + (i * 4))); } while (0);
writel ((0), ioaddr + (RxMissed));
rtl8139_set_rx_mode (dev);
writew ((readw (ioaddr + (MultiIntr)) & MultiIntrClear), ioaddr + (MultiIntr));
tmp = readb (ioaddr + (ChipCmd));
if ((!(tmp & CmdRxEnb)) || (!(tmp & CmdTxEnb)))
writeb ((CmdRxEnb | CmdTxEnb), ioaddr + (ChipCmd));
writew ((rtl8139_intr_mask), ioaddr + (IntrMask));
netif_start_queue (dev);
;
}
static void rtl8139_init_ring (struct net_device *dev)
{
struct rtl8139_private *tp = dev->priv;
int i;
;
tp->cur_rx = 0;
tp->cur_tx = 0;
tp->dirty_tx = 0;
for (i = 0; i < 4; i++) {
tp->tx_info[i].skb = ((void *)0);
tp->tx_info[i].mapping = 0;
tp->tx_buf[i] = &tp->tx_bufs[i * 1536];
}
;
}
static int next_tick = 3 * 100;
static inline void rtl8139_tune_twister (struct net_device *dev,
struct rtl8139_private *tp) {}
# 1600 "8139too.c"
static inline void rtl8139_thread_iter (struct net_device *dev,
struct rtl8139_private *tp,
void *ioaddr)
{
int mii_reg5;
mii_reg5 = mdio_read (dev, tp->phys[0], 5);
if (!tp->duplex_lock && mii_reg5 != 0xffff) {
int duplex = (mii_reg5 & 0x0100)
|| (mii_reg5 & 0x01C0) == 0x0040;
if (tp->full_duplex != duplex) {
tp->full_duplex = duplex;
if (mii_reg5) {
printk (KERN_INFO
"%s: Setting %s-duplex based on MII #%d link"
" partner ability of %4.4x.\n",
dev->name,
tp->full_duplex ? "full" : "half",
tp->phys[0], mii_reg5);
} else {
printk(KERN_INFO"%s: media is unconnected, link down, or incompatible connection\n",
dev->name);
}
}
}
next_tick = 100 * 60;
rtl8139_tune_twister (dev, tp);
;
;
;
}
static int rtl8139_thread (void *data)
{
struct net_device *dev = data;
struct rtl8139_private *tp = dev->priv;
unsigned long timeout;
daemonize ();
reparent_to_init();
do { __asm__ __volatile__("cli": : :"memory"); (void)(¤t->sigmask_lock); } while (0);
sigemptyset(¤t->blocked);
recalc_sigpending(current);
do { do { } while(0); __asm__ __volatile__("sti": : :"memory"); } while (0);
strncpy (current->comm, dev->name, sizeof(current->comm) - 1);
current->comm[sizeof(current->comm) - 1] = '\0';
while (1) {
timeout = next_tick;
do {
timeout = interruptible_sleep_on_timeout (&tp->thr_wait, timeout);
} while (!signal_pending (current) && (timeout > 0));
if (signal_pending (current))
break;
rtnl_lock ();
rtl8139_thread_iter (dev, tp, tp->mmio_addr);
rtnl_unlock ();
}
complete_and_exit (&tp->thr_exited, 0);
}
static void rtl8139_tx_clear (struct rtl8139_private *tp)
{
int i;
tp->cur_tx = 0;
tp->dirty_tx = 0;
for (i = 0; i < 4; i++) {
struct ring_info *rp = &tp->tx_info[i];
if (rp->mapping != 0) {
pci_unmap_single (tp->pci_dev, rp->mapping,
rp->skb->len, PCI_DMA_TODEVICE);
rp->mapping = 0;
}
if (rp->skb) {
dev_kfree_skb (rp->skb);
rp->skb = ((void *)0);
tp->stats.tx_dropped++;
}
}
}
static void rtl8139_tx_timeout (struct net_device *dev)
{
struct rtl8139_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr;
int i;
u8 tmp8;
unsigned long flags;
;
tp->xstats.tx_timeouts++;
tmp8 = readb (ioaddr + (ChipCmd));
if (tmp8 & CmdTxEnb)
writeb ((CmdRxEnb), ioaddr + (ChipCmd));
writew ((0x0000), ioaddr + (IntrMask));
printk (KERN_DEBUG "%s: Tx queue start entry %ld dirty entry %ld.\n",
dev->name, tp->cur_tx, tp->dirty_tx);
for (i = 0; i < 4; i++)
printk (KERN_DEBUG "%s: Tx descriptor %d is %8.8lx.%s\n",
dev->name, i, ((unsigned long) readl (ioaddr + (TxStatus0 + (i * 4)))),
i == tp->dirty_tx % 4 ?
" (queue head)" : "");
do { __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (flags): :"memory"); (void)(&tp->lock); } while (0);
rtl8139_tx_clear (tp);
do { do { } while(0); __asm__ __volatile__("pushl %0 ; popfl": :"g" (flags):"memory", "cc"); } while (0);
rtl8139_hw_start (dev);
netif_wake_queue (dev);
}
static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
{
struct rtl8139_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr;
unsigned int entry;
u32 dma_addr;
__asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory");
entry = tp->cur_tx % 4;
if(!(tp->tx_info[entry].skb == ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "tp->tx_info[entry].skb == NULL","8139too.c",__FUNCTION__,1765); };
if(!(tp->tx_info[entry].mapping == 0)) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "tp->tx_info[entry].mapping == 0","8139too.c",__FUNCTION__,1766); };
tp->tx_info[entry].skb = skb;
if ( !((unsigned long)skb->data & 3) && skb_shinfo(skb)->nr_frags == 0 &&
skb->ip_summed != CHECKSUM_HW) {
tp->xstats.tx_buf_mapped++;
tp->tx_info[entry].mapping =
pci_map_single (tp->pci_dev, skb->data, skb->len,
PCI_DMA_TODEVICE);
dma_addr = tp->tx_info[entry].mapping;
} else if (skb->len < 1536) {
skb_copy_and_csum_dev(skb, tp->tx_buf[entry]);
dma_addr = tp->tx_bufs_dma + (tp->tx_buf[entry] - tp->tx_bufs);
} else {
dev_kfree_skb(skb);
tp->tx_info[entry].skb = ((void *)0);
return 0;
}
do { __asm__ __volatile__("cli": : :"memory"); (void)(&tp->lock); } while (0);
do { writel ((dma_addr), ioaddr + (TxAddr0 + (entry * 4))); readl (ioaddr + (TxAddr0 + (entry * 4))); } while (0);
do { writel ((tp->tx_flag | (skb->len >= 60 ? skb->len : 60)), ioaddr + (TxStatus0 + (entry * sizeof (u32)))); readl (ioaddr + (TxStatus0 + (entry * sizeof (u32)))); } while (0);
dev->trans_start = jiffies;
tp->cur_tx++;
__asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory");
if ((tp->cur_tx - 4) == tp->dirty_tx)
netif_stop_queue (dev);
do { do { } while(0); __asm__ __volatile__("sti": : :"memory"); } while (0);
;
return 0;
}
static void rtl8139_tx_interrupt (struct net_device *dev,
struct rtl8139_private *tp,
void *ioaddr)
{
unsigned long dirty_tx, tx_left;
if(!(dev != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "dev != NULL","8139too.c",__FUNCTION__,1811); };
if(!(tp != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "tp != NULL","8139too.c",__FUNCTION__,1812); };
if(!(ioaddr != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "ioaddr != NULL","8139too.c",__FUNCTION__,1813); };
dirty_tx = tp->dirty_tx;
tx_left = tp->cur_tx - dirty_tx;
while (tx_left > 0) {
int entry = dirty_tx % 4;
int txstatus;
txstatus = ((unsigned long) readl (ioaddr + (TxStatus0 + (entry * sizeof (u32)))));
if (!(txstatus & (TxStatOK | TxUnderrun | TxAborted)))
break;
if (txstatus & (TxOutOfWindow | TxAborted)) {
;
tp->stats.tx_errors++;
if (txstatus & TxAborted) {
tp->stats.tx_aborted_errors++;
do { writel ((TxClearAbt | (6 << TxDMAShift)), ioaddr + (TxConfig)); readl (ioaddr + (TxConfig)); } while (0);
}
if (txstatus & TxCarrierLost)
tp->stats.tx_carrier_errors++;
if (txstatus & TxOutOfWindow)
tp->stats.tx_window_errors++;
} else {
if (txstatus & TxUnderrun) {
if (tp->tx_flag < 0x00300000)
tp->tx_flag += 0x00020000;
tp->stats.tx_fifo_errors++;
}
tp->stats.collisions += (txstatus >> 24) & 15;
tp->stats.tx_bytes += txstatus & 0x7ff;
tp->stats.tx_packets++;
}
if (tp->tx_info[entry].mapping != 0) {
pci_unmap_single(tp->pci_dev,
tp->tx_info[entry].mapping,
tp->tx_info[entry].skb->len,
PCI_DMA_TODEVICE);
tp->tx_info[entry].mapping = 0;
}
dev_kfree_skb_irq (tp->tx_info[entry].skb);
tp->tx_info[entry].skb = ((void *)0);
dirty_tx++;
tx_left--;
}
if (tp->cur_tx - dirty_tx > 4) {
printk (KERN_ERR "%s: Out-of-sync dirty pointer, %ld vs. %ld.\n",
dev->name, dirty_tx, tp->cur_tx);
dirty_tx += 4;
}
if (tp->dirty_tx != dirty_tx) {
tp->dirty_tx = dirty_tx;
__asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory");
if (netif_queue_stopped (dev))
netif_wake_queue (dev);
}
}
static void rtl8139_rx_err (u32 rx_status, struct net_device *dev,
struct rtl8139_private *tp, void *ioaddr)
{
u8 tmp8;
int tmp_work;
;
if (rx_status & RxTooLong) {
;
}
tp->stats.rx_errors++;
if (rx_status & (RxBadSymbol | RxBadAlign))
tp->stats.rx_frame_errors++;
if (rx_status & (RxRunt | RxTooLong))
tp->stats.rx_length_errors++;
if (rx_status & RxCRCErr)
tp->stats.rx_crc_errors++;
do { writeb ((CmdTxEnb), ioaddr + (ChipCmd)); readb (ioaddr + (ChipCmd)); } while (0);
tmp_work = 200;
while (--tmp_work > 0) {
(__builtin_constant_p(1) ? ((1) > 20000 ? __bad_udelay() : __const_udelay((1) * 0x10c6ul)) : __udelay(1));
tmp8 = readb (ioaddr + (ChipCmd));
if (!(tmp8 & CmdRxEnb))
break;
}
if (tmp_work <= 0)
printk (KERN_WARNING "8139too" ": " "rx stop wait too long\n");
tmp_work = 200;
while (--tmp_work > 0) {
do { writeb ((CmdRxEnb | CmdTxEnb), ioaddr + (ChipCmd)); readb (ioaddr + (ChipCmd)); } while (0);
(__builtin_constant_p(1) ? ((1) > 20000 ? __bad_udelay() : __const_udelay((1) * 0x10c6ul)) : __udelay(1));
tmp8 = readb (ioaddr + (ChipCmd));
if ((tmp8 & CmdRxEnb) && (tmp8 & CmdTxEnb))
break;
}
if (tmp_work <= 0)
printk (KERN_WARNING "8139too" ": " "tx/rx enable wait too long\n");
do { writeb ((Cfg9346_Unlock), ioaddr + (Cfg9346)); readb (ioaddr + (Cfg9346)); } while (0);
writeb ((CmdRxEnb | CmdTxEnb), ioaddr + (ChipCmd));
tp->rx_config = rtl8139_rx_config | AcceptBroadcast | AcceptMyPhys;
writel ((tp->rx_config), ioaddr + (RxConfig));
tp->cur_rx = 0;
;
writeb ((Cfg9346_Lock), ioaddr + (Cfg9346));
do { writel ((tp->rx_ring_dma), ioaddr + (RxBuf)); readl (ioaddr + (RxBuf)); } while (0);
__set_rx_mode (dev);
}
static void rtl8139_rx_interrupt (struct net_device *dev,
struct rtl8139_private *tp, void *ioaddr)
{
unsigned char *rx_ring;
u16 cur_rx;
if(!(dev != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "dev != NULL","8139too.c",__FUNCTION__,1963); };
if(!(tp != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "tp != NULL","8139too.c",__FUNCTION__,1964); };
if(!(ioaddr != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "ioaddr != NULL","8139too.c",__FUNCTION__,1965); };
rx_ring = tp->rx_ring;
cur_rx = tp->cur_rx;
;
while ((readb (ioaddr + (ChipCmd)) & RxBufEmpty) == 0) {
int ring_offset = cur_rx % (8192 << 2);
u32 rx_status;
unsigned int rx_size;
unsigned int pkt_size;
struct sk_buff *skb;
__asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory");
rx_status = le32_to_cpu (*(u32 *) (rx_ring + ring_offset));
rx_size = rx_status >> 16;
pkt_size = rx_size - 4;
;
# 2003 "8139too.c"
if (rx_size == 0xfff0) {
tp->xstats.early_rx++;
break;
}
if ((rx_size > (1536 +4)) ||
(rx_size < 8) ||
(!(rx_status & RxStatusOK))) {
rtl8139_rx_err (rx_status, dev, tp, ioaddr);
return;
}
# 2029 "8139too.c"
skb = dev_alloc_skb (pkt_size + 2);
if (skb) {
skb->dev = dev;
skb_reserve (skb, 2);
eth_copy_and_sum (skb, &rx_ring[ring_offset + 4], pkt_size, 0);
skb_put (skb, pkt_size);
skb->protocol = eth_type_trans (skb, dev);
netif_rx (skb);
dev->last_rx = jiffies;
tp->stats.rx_bytes += pkt_size;
tp->stats.rx_packets++;
} else {
printk (KERN_WARNING
"%s: Memory squeeze, dropping packet.\n",
dev->name);
tp->stats.rx_dropped++;
}
cur_rx = (cur_rx + rx_size + 4 + 3) & ~3;
writew ((cur_rx - 16), ioaddr + (RxBufPtr));
if (readw (ioaddr + (IntrStatus)) & RxAckBits)
do { writew ((RxAckBits), ioaddr + (IntrStatus)); readw (ioaddr + (IntrStatus)); } while (0);
}
;
tp->cur_rx = cur_rx;
if ((readb (ioaddr + (ChipCmd)) & RxBufEmpty) &&
(readw (ioaddr + (IntrStatus)) & RxAckBits))
do { writew ((RxAckBits), ioaddr + (IntrStatus)); readw (ioaddr + (IntrStatus)); } while (0);
}
static void rtl8139_weird_interrupt (struct net_device *dev,
struct rtl8139_private *tp,
void *ioaddr,
int status, int link_changed)
{
;
if(!(dev != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "dev != NULL","8139too.c",__FUNCTION__,2077); };
if(!(tp != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "tp != NULL","8139too.c",__FUNCTION__,2078); };
if(!(ioaddr != ((void *)0))) { printk( "Assertion failed! %s,%s,%s,line=%d\n", "ioaddr != NULL","8139too.c",__FUNCTION__,2079); };
tp->stats.rx_missed_errors += ((unsigned long) readl (ioaddr + (RxMissed)));
writel ((0), ioaddr + (RxMissed));
if ((status & RxUnderrun) && link_changed &&
(tp->drv_flags & HAS_LNK_CHNG)) {
int lpar = readw (ioaddr + (NWayLPAR));
int duplex = (lpar & 0x0100) || (lpar & 0x01C0) == 0x0040
|| tp->duplex_lock;
if (tp->full_duplex != duplex) {
tp->full_duplex = duplex;
}
status &= ~RxUnderrun;
}
if (status &
(RxUnderrun | RxOverflow | RxErr | RxFIFOOver))
tp->stats.rx_errors++;
if (status & (PCSTimeout))
tp->stats.rx_length_errors++;
if (status & (RxUnderrun | RxFIFOOver))
tp->stats.rx_fifo_errors++;
if (status & PCIErr) {
u16 pci_cmd_status;
pci_read_config_word (tp->pci_dev, 0x06, &pci_cmd_status);
printk (KERN_ERR "%s: PCI Bus error %4.4x.\n",
dev->name, pci_cmd_status);
}
}
static void rtl8139_interrupt (int irq, void *dev_instance,
struct pt_regs *regs)
{
struct net_device *dev = (struct net_device *) dev_instance;
struct rtl8139_private *tp = dev->priv;
int boguscnt = max_interrupt_work;
void *ioaddr = tp->mmio_addr;
int ackstat, status;
int link_changed = 0;
(void)(&tp->lock);
do {
status = readw (ioaddr + (IntrStatus));
if (status == 0xFFFF)
break;
if (status & RxUnderrun)
link_changed = readw (ioaddr + (CSCR)) & CSCR_LinkChangeBit;
ackstat = status & ~RxAckBits;
writew ((ackstat), ioaddr + (IntrStatus));
;
if ((status &
(PCIErr | PCSTimeout | RxUnderrun | RxOverflow |
RxFIFOOver | TxErr | TxOK | RxErr | RxOK)) == 0)
break;
if (netif_running (dev) && (status & RxAckBits))
rtl8139_rx_interrupt (dev, tp, ioaddr);
if (status & (PCIErr | PCSTimeout | RxUnderrun | RxOverflow |
RxFIFOOver | TxErr | RxErr))
rtl8139_weird_interrupt (dev, tp, ioaddr,
status, link_changed);
if (netif_running (dev) && (status & (TxOK | TxErr)))
rtl8139_tx_interrupt (dev, tp, ioaddr);
boguscnt--;
} while (boguscnt > 0);
if (boguscnt <= 0) {
printk (KERN_WARNING "%s: Too much work at interrupt, "
"IntrStatus=0x%4.4x.\n", dev->name, status);
writew ((0xffff), ioaddr + (IntrStatus));
}
do { } while(0);
;
}
static int rtl8139_close (struct net_device *dev)
{
struct rtl8139_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr;
int ret = 0;
unsigned long flags;
;
netif_stop_queue (dev);
if (tp->thr_pid >= 0) {
ret = kill_proc (tp->thr_pid, 15, 1);
if (ret) {
printk (KERN_ERR "%s: unable to signal thread\n", dev->name);
return ret;
}
wait_for_completion (&tp->thr_exited);
}
;
do { __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (flags): :"memory"); (void)(&tp->lock); } while (0);
writeb ((0), ioaddr + (ChipCmd));
writew ((0), ioaddr + (IntrMask));
tp->stats.rx_missed_errors += ((unsigned long) readl (ioaddr + (RxMissed)));
writel ((0), ioaddr + (RxMissed));
do { do { } while(0); __asm__ __volatile__("pushl %0 ; popfl": :"g" (flags):"memory", "cc"); } while (0);
synchronize_irq ();
free_irq (dev->irq, dev);
rtl8139_tx_clear (tp);
pci_free_consistent(tp->pci_dev, ((8192 << 2) + 16 + 2048),
tp->rx_ring, tp->rx_ring_dma);
pci_free_consistent(tp->pci_dev, (1536 * 4),
tp->tx_bufs, tp->tx_bufs_dma);
tp->rx_ring = ((void *)0);
tp->tx_bufs = ((void *)0);
writeb ((Cfg9346_Unlock), ioaddr + (Cfg9346));
if (rtl_chip_info[tp->chipset].flags & HasHltClk)
writeb (('H'), ioaddr + (HltClk));
;
return 0;
}
static void netdev_get_eset (struct net_device *dev, struct ethtool_cmd *eset)
{
struct rtl8139_private *np = dev->priv;
void *ioaddr = np->mmio_addr;
u16 advert;
eset->supported = (1 << 0)
| (1 << 1)
| (1 << 2)
| (1 << 3)
| (1 << 6)
| (1 << 7);
eset->advertising = (1 << 7) | (1 << 6);
advert = mdio_read (dev, np->phys[0], 4);
if (advert & 0x0020)
eset->advertising |= (1 << 0);
if (advert & 0x0040)
eset->advertising |= (1 << 1);
if (advert & 0x0080)
eset->advertising |= (1 << 2);
if (advert & 0x0100)
eset->advertising |= (1 << 3);
eset->speed = (readb (ioaddr + (MediaStatus)) & 0x08) ? 10 : 100;
eset->duplex = np->full_duplex ? 0x01 : 0x00;
eset->port = 0x00;
eset->phy_address = np->phys[0];
eset->transceiver = 0x00;
eset->autoneg = (mdio_read (dev, np->phys[0], 0) & 0x1000) != 0;
eset->maxtxpkt = 1;
eset->maxrxpkt = 1;
}
static void netdev_get_wol (struct net_device *dev, struct ethtool_wolinfo *wol)
{
struct rtl8139_private *np = dev->priv;
void *ioaddr = np->mmio_addr;
if (rtl_chip_info[np->chipset].flags & HasLWake) {
u8 cfg3 = readb (ioaddr + (Config3));
u8 cfg5 = readb (ioaddr + (Config5));
wol->supported = (1 << 0) | (1 << 5)
| (1 << 1) | (1 << 2) | (1 << 3);
wol->wolopts = 0;
if (cfg3 & Cfg3_LinkUp)
wol->wolopts |= (1 << 0);
if (cfg3 & Cfg3_Magic)
wol->wolopts |= (1 << 5);
if (cfg5 & Cfg5_UWF)
wol->wolopts |= (1 << 1);
if (cfg5 & Cfg5_MWF)
wol->wolopts |= (1 << 2);
if (cfg5 & Cfg5_BWF)
wol->wolopts |= (1 << 3);
}
}
static int netdev_set_wol (struct net_device *dev,
const struct ethtool_wolinfo *wol)
{
struct rtl8139_private *np = dev->priv;
void *ioaddr = np->mmio_addr;
u32 support;
u8 cfg3, cfg5;
support = ((rtl_chip_info[np->chipset].flags & HasLWake)
? ((1 << 0) | (1 << 5)
| (1 << 1) | (1 << 2) | (1 << 3))
: 0);
if (wol->wolopts & ~support)
return -EINVAL;
cfg3 = readb (ioaddr + (Config3)) & ~(Cfg3_LinkUp | Cfg3_Magic);
if (wol->wolopts & (1 << 0))
cfg3 |= Cfg3_LinkUp;
if (wol->wolopts & (1 << 5))
cfg3 |= Cfg3_Magic;
writeb ((Cfg9346_Unlock), ioaddr + (Cfg9346));
writeb ((cfg3), ioaddr + (Config3));
writeb ((Cfg9346_Lock), ioaddr + (Cfg9346));
cfg5 = readb (ioaddr + (Config5)) & ~(Cfg5_UWF | Cfg5_MWF | Cfg5_BWF);
if (wol->wolopts & (1 << 1))
cfg5 |= Cfg5_UWF;
if (wol->wolopts & (1 << 2))
cfg5 |= Cfg5_MWF;
if (wol->wolopts & (1 << 3))
cfg5 |= Cfg5_BWF;
writeb ((cfg5), ioaddr + (Config5));
return 0;
}
static int netdev_ethtool_ioctl (struct net_device *dev, void *useraddr)
{
struct rtl8139_private *np = dev->priv;
u32 ethcmd;
if ((__builtin_constant_p(sizeof (ethcmd)) ? __constant_copy_from_user((ðcmd),(useraddr),(sizeof (ethcmd))) : __generic_copy_from_user((ðcmd),(useraddr),(sizeof (ethcmd)))))
return -EFAULT;
switch (ethcmd) {
case 0x00000001:
{
struct ethtool_cmd eset = { 0x00000001 };
do { __asm__ __volatile__("cli": : :"memory"); (void)(&np->lock); } while (0);
netdev_get_eset (dev, &eset);
do { do { } while(0); __asm__ __volatile__("sti": : :"memory"); } while (0);
if ((__builtin_constant_p(sizeof (eset)) ? __constant_copy_to_user((useraddr),(&eset),(sizeof (eset))) : __generic_copy_to_user((useraddr),(&eset),(sizeof (eset)))))
return -EFAULT;
return 0;
}
case 0x00000003:
{
struct ethtool_drvinfo info = { 0x00000003 };
strcpy (info.driver, "8139too");
strcpy (info.version, "0.9.20");
strcpy (info.bus_info, np->pci_dev->slot_name);
if ((__builtin_constant_p(sizeof (info)) ? __constant_copy_to_user((useraddr),(&info),(sizeof (info))) : __generic_copy_to_user((useraddr),(&info),(sizeof (info)))))
return -EFAULT;
return 0;
}
case 0x00000005:
{
struct ethtool_wolinfo wol = { 0x00000005 };
do { __asm__ __volatile__("cli": : :"memory"); (void)(&np->lock); } while (0);
netdev_get_wol (dev, &wol);
do { do { } while(0); __asm__ __volatile__("sti": : :"memory"); } while (0);
if ((__builtin_constant_p(sizeof (wol)) ? __constant_copy_to_user((useraddr),(&wol),(sizeof (wol))) : __generic_copy_to_user((useraddr),(&wol),(sizeof (wol)))))
return -EFAULT;
return 0;
}
case 0x00000006:
{
struct ethtool_wolinfo wol;
int rc;
if ((__builtin_constant_p(sizeof (wol)) ? __constant_copy_from_user((&wol),(useraddr),(sizeof (wol))) : __generic_copy_from_user((&wol),(useraddr),(sizeof (wol)))))
return -EFAULT;
do { __asm__ __volatile__("cli": : :"memory"); (void)(&np->lock); } while (0);
rc = netdev_set_wol (dev, &wol);
do { do { } while(0); __asm__ __volatile__("sti": : :"memory"); } while (0);
return rc;
}
default:
break;
}
return -EOPNOTSUPP;
}
static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
{
struct rtl8139_private *tp = dev->priv;
struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_ifru.ifru_data;
int rc = 0;
int phy = tp->phys[0] & 0x3f;
;
if (cmd != 0x8946) {
data->phy_id &= 0x1f;
data->reg_num &= 0x1f;
}
switch (cmd) {
case 0x8946:
return netdev_ethtool_ioctl(dev, (void *) rq->ifr_ifru.ifru_data);
case 0x8947:
case 0x89F0:
data->phy_id = phy;
case 0x8948:
case 0x89F0 +1:
data->val_out = mdio_read (dev, data->phy_id, data->reg_num);
break;
case 0x8949:
case 0x89F0 +2:
if (!capable (12)) {
rc = -EPERM;
break;
}
if (data->phy_id == phy) {
u16 value = data->val_in;
switch (data->reg_num) {
case 0:
tp->medialock = (value & 0x9000) ? 0 : 1;
if (tp->medialock)
tp->full_duplex = (value & 0x0100) ? 1 : 0;
break;
case 4: break;
}
}
mdio_write(dev, data->phy_id, data->reg_num, data->val_in);
break;
default:
rc = -EOPNOTSUPP;
break;
}
;
return rc;
}
static struct net_device_stats *rtl8139_get_stats (struct net_device *dev)
{
struct rtl8139_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr;
unsigned long flags;
;
if (netif_running(dev)) {
do { __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (flags): :"memory"); (void)(&tp->lock); } while (0);
tp->stats.rx_missed_errors += ((unsigned long) readl (ioaddr + (RxMissed)));
writel ((0), ioaddr + (RxMissed));
do { do { } while(0); __asm__ __volatile__("pushl %0 ; popfl": :"g" (flags):"memory", "cc"); } while (0);
}
;
return &tp->stats;
}
static unsigned const ethernet_polynomial = 0x04c11db7U;
static inline u32 ether_crc (int length, unsigned char *data)
{
int crc = -1;
;
while (--length >= 0) {
unsigned char current_octet = *data++;
int bit;
for (bit = 0; bit < 8; bit++, current_octet >>= 1)
crc = (crc << 1) ^ ((crc < 0) ^ (current_octet & 1) ?
ethernet_polynomial : 0);
}
;
return crc;
}
static void __set_rx_mode (struct net_device *dev)
{
struct rtl8139_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr;
u32 mc_filter[2];
int i, rx_mode;
u32 tmp;
;
;
if (dev->flags & 0x100) {
printk (KERN_NOTICE "%s: Promiscuous mode enabled.\n",
dev->name);
rx_mode =
AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
AcceptAllPhys;
mc_filter[1] = mc_filter[0] = 0xffffffff;
} else if ((dev->mc_count > multicast_filter_limit)
|| (dev->flags & 0x200)) {
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
mc_filter[1] = mc_filter[0] = 0xffffffff;
} else {
struct dev_mc_list *mclist;
rx_mode = AcceptBroadcast | AcceptMyPhys;
mc_filter[1] = mc_filter[0] = 0;
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
i++, mclist = mclist->next) {
int bit_nr = ether_crc(6, mclist->dmi_addr) >> 26;
mc_filter[bit_nr >> 5] |= cpu_to_le32(1 << (bit_nr & 31));
rx_mode |= AcceptMulticast;
}
}
tmp = rtl8139_rx_config | rx_mode;
if (tp->rx_config != tmp) {
do { writel ((tmp), ioaddr + (RxConfig)); readl (ioaddr + (RxConfig)); } while (0);
tp->rx_config = tmp;
}
do { writel ((mc_filter[0]), ioaddr + (MAR0 + 0)); readl (ioaddr + (MAR0 + 0)); } while (0);
do { writel ((mc_filter[1]), ioaddr + (MAR0 + 4)); readl (ioaddr + (MAR0 + 4)); } while (0);
;
}
static void rtl8139_set_rx_mode (struct net_device *dev)
{
unsigned long flags;
struct rtl8139_private *tp = dev->priv;
do { __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (flags): :"memory"); (void)(&tp->lock); } while (0);
__set_rx_mode(dev);
do { do { } while(0); __asm__ __volatile__("pushl %0 ; popfl": :"g" (flags):"memory", "cc"); } while (0);
}
# 2644 "8139too.c"
static struct pci_driver rtl8139_pci_driver = {
name: "8139too",
id_table: rtl8139_pci_tbl,
probe: rtl8139_init_one,
remove: rtl8139_remove_one,
};
static int __attribute__ ((__section__ (".text.init"))) rtl8139_init_module (void)
{
return pci_module_init (&rtl8139_pci_driver);
}
static void __attribute__ ((unused, __section__(".text.exit"))) rtl8139_cleanup_module (void)
{
pci_unregister_driver (&rtl8139_pci_driver);
}
static initcall_t __initcall_rtl8139_init_module __attribute__ ((unused,__section__ (".initcall.init"))) = rtl8139_init_module;;
static exitcall_t __exitcall_rtl8139_cleanup_module __attribute__ ((unused,__section__ (".exitcall.exit"))) = rtl8139_cleanup_module;;
>Fix:
unknown
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-11-19 23:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-14 10:56 c/4910: Cannot compile kernel 2.4.14 8139too.c network driver imacat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).