Commit 7ce103b4 authored by Alexander Viro's avatar Alexander Viro Committed by Stephen Hemminger

[wireless wavelan{_cs}] use alloc_etherdev; remove useless net_device* typedef

parent ab40fdb6
...@@ -153,7 +153,7 @@ static inline void wv_16_on(unsigned long ioaddr, u16 hacr) ...@@ -153,7 +153,7 @@ static inline void wv_16_on(unsigned long ioaddr, u16 hacr)
* Disable interrupts on the WaveLAN hardware. * Disable interrupts on the WaveLAN hardware.
* (called by wv_82586_stop()) * (called by wv_82586_stop())
*/ */
static inline void wv_ints_off(device * dev) static inline void wv_ints_off(struct net_device * dev)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
...@@ -167,7 +167,7 @@ static inline void wv_ints_off(device * dev) ...@@ -167,7 +167,7 @@ static inline void wv_ints_off(device * dev)
* Enable interrupts on the WaveLAN hardware. * Enable interrupts on the WaveLAN hardware.
* (called by wv_hw_reset()) * (called by wv_hw_reset())
*/ */
static inline void wv_ints_on(device * dev) static inline void wv_ints_on(struct net_device * dev)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
...@@ -268,7 +268,7 @@ static inline u16 psa_crc(u8 * psa, /* The PSA */ ...@@ -268,7 +268,7 @@ static inline u16 psa_crc(u8 * psa, /* The PSA */
/* /*
* update the checksum field in the Wavelan's PSA * update the checksum field in the Wavelan's PSA
*/ */
static void update_psa_checksum(device * dev, unsigned long ioaddr, u16 hacr) static void update_psa_checksum(struct net_device * dev, unsigned long ioaddr, u16 hacr)
{ {
#ifdef SET_PSA_CRC #ifdef SET_PSA_CRC
psa_t psa; psa_t psa;
...@@ -547,7 +547,7 @@ static inline void obram_write(unsigned long ioaddr, u16 o, u8 * b, int n) ...@@ -547,7 +547,7 @@ static inline void obram_write(unsigned long ioaddr, u16 o, u8 * b, int n)
/* /*
* Acknowledge the reading of the status issued by the i82586. * Acknowledge the reading of the status issued by the i82586.
*/ */
static void wv_ack(device * dev) static void wv_ack(struct net_device * dev)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
...@@ -589,7 +589,7 @@ static void wv_ack(device * dev) ...@@ -589,7 +589,7 @@ static void wv_ack(device * dev)
* Set channel attention bit and busy wait until command has * Set channel attention bit and busy wait until command has
* completed, then acknowledge completion of the command. * completed, then acknowledge completion of the command.
*/ */
static inline int wv_synchronous_cmd(device * dev, const char *str) static inline int wv_synchronous_cmd(struct net_device * dev, const char *str)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
...@@ -636,7 +636,7 @@ static inline int wv_synchronous_cmd(device * dev, const char *str) ...@@ -636,7 +636,7 @@ static inline int wv_synchronous_cmd(device * dev, const char *str)
* Check if done, and if OK. * Check if done, and if OK.
*/ */
static inline int static inline int
wv_config_complete(device * dev, unsigned long ioaddr, net_local * lp) wv_config_complete(struct net_device * dev, unsigned long ioaddr, net_local * lp)
{ {
unsigned short mcs_addr; unsigned short mcs_addr;
unsigned short status; unsigned short status;
...@@ -703,7 +703,7 @@ wv_config_complete(device * dev, unsigned long ioaddr, net_local * lp) ...@@ -703,7 +703,7 @@ wv_config_complete(device * dev, unsigned long ioaddr, net_local * lp)
* (called in wavelan_interrupt()). * (called in wavelan_interrupt()).
* Note : the spinlock is already grabbed for us. * Note : the spinlock is already grabbed for us.
*/ */
static int wv_complete(device * dev, unsigned long ioaddr, net_local * lp) static int wv_complete(struct net_device * dev, unsigned long ioaddr, net_local * lp)
{ {
int nreaped = 0; int nreaped = 0;
...@@ -845,7 +845,7 @@ if (lp->tx_n_in_use > 0) ...@@ -845,7 +845,7 @@ if (lp->tx_n_in_use > 0)
* wavelan_interrupt is not an option), so you may experience * wavelan_interrupt is not an option), so you may experience
* delays sometimes. * delays sometimes.
*/ */
static inline void wv_82586_reconfig(device * dev) static inline void wv_82586_reconfig(struct net_device * dev)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
unsigned long flags; unsigned long flags;
...@@ -954,7 +954,7 @@ static void wv_psa_show(psa_t * p) ...@@ -954,7 +954,7 @@ static void wv_psa_show(psa_t * p)
* Print the formatted status of the Modem Management Controller. * Print the formatted status of the Modem Management Controller.
* This function needs to be completed. * This function needs to be completed.
*/ */
static void wv_mmc_show(device * dev) static void wv_mmc_show(struct net_device * dev)
{ {
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
...@@ -1137,7 +1137,7 @@ static void wv_scb_show(unsigned long ioaddr) ...@@ -1137,7 +1137,7 @@ static void wv_scb_show(unsigned long ioaddr)
/* /*
* Print the formatted status of the i82586's receive unit. * Print the formatted status of the i82586's receive unit.
*/ */
static void wv_ru_show(device * dev) static void wv_ru_show(struct net_device * dev)
{ {
/* net_local *lp = (net_local *) dev->priv; */ /* net_local *lp = (net_local *) dev->priv; */
...@@ -1154,7 +1154,7 @@ static void wv_ru_show(device * dev) ...@@ -1154,7 +1154,7 @@ static void wv_ru_show(device * dev)
/* /*
* Display info about one control block of the i82586 memory. * Display info about one control block of the i82586 memory.
*/ */
static void wv_cu_show_one(device * dev, net_local * lp, int i, u16 p) static void wv_cu_show_one(struct net_device * dev, net_local * lp, int i, u16 p)
{ {
unsigned long ioaddr; unsigned long ioaddr;
ac_tx_t actx; ac_tx_t actx;
...@@ -1183,7 +1183,7 @@ static void wv_cu_show_one(device * dev, net_local * lp, int i, u16 p) ...@@ -1183,7 +1183,7 @@ static void wv_cu_show_one(device * dev, net_local * lp, int i, u16 p)
/* /*
* Print status of the command unit of the i82586. * Print status of the command unit of the i82586.
*/ */
static void wv_cu_show(device * dev) static void wv_cu_show(struct net_device * dev)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
unsigned int i; unsigned int i;
...@@ -1209,7 +1209,7 @@ static void wv_cu_show(device * dev) ...@@ -1209,7 +1209,7 @@ static void wv_cu_show(device * dev)
/* /*
* Print the formatted status of the WaveLAN PCMCIA device driver. * Print the formatted status of the WaveLAN PCMCIA device driver.
*/ */
static void wv_dev_show(device * dev) static void wv_dev_show(struct net_device * dev)
{ {
printk(KERN_DEBUG "dev:"); printk(KERN_DEBUG "dev:");
printk(" state=%lX,", dev->state); printk(" state=%lX,", dev->state);
...@@ -1223,7 +1223,7 @@ static void wv_dev_show(device * dev) ...@@ -1223,7 +1223,7 @@ static void wv_dev_show(device * dev)
* Print the formatted status of the WaveLAN PCMCIA device driver's * Print the formatted status of the WaveLAN PCMCIA device driver's
* private information. * private information.
*/ */
static void wv_local_show(device * dev) static void wv_local_show(struct net_device * dev)
{ {
net_local *lp; net_local *lp;
...@@ -1285,7 +1285,7 @@ static inline void wv_packet_info(u8 * p, /* Packet to dump */ ...@@ -1285,7 +1285,7 @@ static inline void wv_packet_info(u8 * p, /* Packet to dump */
* This is the information which is displayed by the driver at startup. * This is the information which is displayed by the driver at startup.
* There are lots of flags for configuring it to your liking. * There are lots of flags for configuring it to your liking.
*/ */
static inline void wv_init_info(device * dev) static inline void wv_init_info(struct net_device * dev)
{ {
short ioaddr = dev->base_addr; short ioaddr = dev->base_addr;
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
...@@ -1395,7 +1395,7 @@ static inline void wv_init_info(device * dev) ...@@ -1395,7 +1395,7 @@ static inline void wv_init_info(device * dev)
* card open or closed. * card open or closed.
* Used when the user read /proc/net/dev * Used when the user read /proc/net/dev
*/ */
static en_stats *wavelan_get_stats(device * dev) static en_stats *wavelan_get_stats(struct net_device * dev)
{ {
#ifdef DEBUG_IOCTL_TRACE #ifdef DEBUG_IOCTL_TRACE
printk(KERN_DEBUG "%s: <>wavelan_get_stats()\n", dev->name); printk(KERN_DEBUG "%s: <>wavelan_get_stats()\n", dev->name);
...@@ -1412,7 +1412,7 @@ static en_stats *wavelan_get_stats(device * dev) ...@@ -1412,7 +1412,7 @@ static en_stats *wavelan_get_stats(device * dev)
* num_addrs > 0 Multicast mode, receive normal and MC packets, * num_addrs > 0 Multicast mode, receive normal and MC packets,
* and do best-effort filtering. * and do best-effort filtering.
*/ */
static void wavelan_set_multicast_list(device * dev) static void wavelan_set_multicast_list(struct net_device * dev)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
...@@ -1485,7 +1485,7 @@ static void wavelan_set_multicast_list(device * dev) ...@@ -1485,7 +1485,7 @@ static void wavelan_set_multicast_list(device * dev)
* (Note : it was a nice way to test the reconfigure stuff...) * (Note : it was a nice way to test the reconfigure stuff...)
*/ */
#ifdef SET_MAC_ADDRESS #ifdef SET_MAC_ADDRESS
static int wavelan_set_mac_address(device * dev, void *addr) static int wavelan_set_mac_address(struct net_device * dev, void *addr)
{ {
struct sockaddr *mac = addr; struct sockaddr *mac = addr;
...@@ -1724,7 +1724,7 @@ static inline int wv_frequency_list(unsigned long ioaddr, /* I/O port of the car ...@@ -1724,7 +1724,7 @@ static inline int wv_frequency_list(unsigned long ioaddr, /* I/O port of the car
* address with our list, and if they match, get the statistics. * address with our list, and if they match, get the statistics.
* Sorry, but this function really needs the wireless extensions. * Sorry, but this function really needs the wireless extensions.
*/ */
static inline void wl_spy_gather(device * dev, static inline void wl_spy_gather(struct net_device * dev,
u8 * mac, /* MAC address */ u8 * mac, /* MAC address */
u8 * stats) /* Statistics to gather */ u8 * stats) /* Statistics to gather */
{ {
...@@ -1750,7 +1750,7 @@ static inline void wl_spy_gather(device * dev, ...@@ -1750,7 +1750,7 @@ static inline void wl_spy_gather(device * dev,
* With this histogram you may detect if one WaveLAN is really weak, * With this histogram you may detect if one WaveLAN is really weak,
* or you may also calculate the mean and standard deviation of the level. * or you may also calculate the mean and standard deviation of the level.
*/ */
static inline void wl_his_gather(device * dev, u8 * stats) static inline void wl_his_gather(struct net_device * dev, u8 * stats)
{ /* Statistics to gather */ { /* Statistics to gather */
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
u8 level = stats[0] & MMR_SIGNAL_LVL; u8 level = stats[0] & MMR_SIGNAL_LVL;
...@@ -2415,7 +2415,7 @@ static const struct iw_handler_def wavelan_handler_def = ...@@ -2415,7 +2415,7 @@ static const struct iw_handler_def wavelan_handler_def =
* Get wireless statistics. * Get wireless statistics.
* Called by /proc/net/wireless * Called by /proc/net/wireless
*/ */
static iw_stats *wavelan_get_wireless_stats(device * dev) static iw_stats *wavelan_get_wireless_stats(struct net_device * dev)
{ {
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
...@@ -2492,7 +2492,7 @@ static iw_stats *wavelan_get_wireless_stats(device * dev) ...@@ -2492,7 +2492,7 @@ static iw_stats *wavelan_get_wireless_stats(device * dev)
* (called by wv_packet_rcv()) * (called by wv_packet_rcv())
*/ */
static inline void static inline void
wv_packet_read(device * dev, u16 buf_off, int sksize) wv_packet_read(struct net_device * dev, u16 buf_off, int sksize)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
...@@ -2587,7 +2587,7 @@ wv_packet_read(device * dev, u16 buf_off, int sksize) ...@@ -2587,7 +2587,7 @@ wv_packet_read(device * dev, u16 buf_off, int sksize)
* (called in wavelan_interrupt()). * (called in wavelan_interrupt()).
* Note : the spinlock is already grabbed for us. * Note : the spinlock is already grabbed for us.
*/ */
static inline void wv_receive(device * dev) static inline void wv_receive(struct net_device * dev)
{ {
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
...@@ -2770,7 +2770,7 @@ static inline void wv_receive(device * dev) ...@@ -2770,7 +2770,7 @@ static inline void wv_receive(device * dev)
* *
* (called in wavelan_packet_xmit()) * (called in wavelan_packet_xmit())
*/ */
static inline int wv_packet_write(device * dev, void *buf, short length) static inline int wv_packet_write(struct net_device * dev, void *buf, short length)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
...@@ -2901,7 +2901,7 @@ static inline int wv_packet_write(device * dev, void *buf, short length) ...@@ -2901,7 +2901,7 @@ static inline int wv_packet_write(device * dev, void *buf, short length)
* the packet. We also prevent reentrance. Then we call the function * the packet. We also prevent reentrance. Then we call the function
* to send the packet. * to send the packet.
*/ */
static int wavelan_packet_xmit(struct sk_buff *skb, device * dev) static int wavelan_packet_xmit(struct sk_buff *skb, struct net_device * dev)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
unsigned long flags; unsigned long flags;
...@@ -2966,7 +2966,7 @@ static int wavelan_packet_xmit(struct sk_buff *skb, device * dev) ...@@ -2966,7 +2966,7 @@ static int wavelan_packet_xmit(struct sk_buff *skb, device * dev)
* Routine to initialize the Modem Management Controller. * Routine to initialize the Modem Management Controller.
* (called by wv_hw_reset()) * (called by wv_hw_reset())
*/ */
static inline int wv_mmc_init(device * dev) static inline int wv_mmc_init(struct net_device * dev)
{ {
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
...@@ -3138,7 +3138,7 @@ static inline int wv_mmc_init(device * dev) ...@@ -3138,7 +3138,7 @@ static inline int wv_mmc_init(device * dev)
* Start the receive unit. * Start the receive unit.
* (called by wv_hw_reset()) * (called by wv_hw_reset())
*/ */
static inline int wv_ru_start(device * dev) static inline int wv_ru_start(struct net_device * dev)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
...@@ -3230,7 +3230,7 @@ static inline int wv_ru_start(device * dev) ...@@ -3230,7 +3230,7 @@ static inline int wv_ru_start(device * dev)
* *
* (called by wv_hw_reset()) * (called by wv_hw_reset())
*/ */
static inline int wv_cu_start(device * dev) static inline int wv_cu_start(struct net_device * dev)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
...@@ -3331,7 +3331,7 @@ static inline int wv_cu_start(device * dev) ...@@ -3331,7 +3331,7 @@ static inline int wv_cu_start(device * dev)
* *
* (called by wv_hw_reset()) * (called by wv_hw_reset())
*/ */
static inline int wv_82586_start(device * dev) static inline int wv_82586_start(struct net_device * dev)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
...@@ -3463,7 +3463,7 @@ static inline int wv_82586_start(device * dev) ...@@ -3463,7 +3463,7 @@ static inline int wv_82586_start(device * dev)
* *
* (called by wv_hw_reset(), wv_82586_reconfig(), wavelan_packet_xmit()) * (called by wv_hw_reset(), wv_82586_reconfig(), wavelan_packet_xmit())
*/ */
static void wv_82586_config(device * dev) static void wv_82586_config(struct net_device * dev)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
...@@ -3643,7 +3643,7 @@ static void wv_82586_config(device * dev) ...@@ -3643,7 +3643,7 @@ static void wv_82586_config(device * dev)
* WaveLAN controller (i82586). * WaveLAN controller (i82586).
* (called by wavelan_close()) * (called by wavelan_close())
*/ */
static inline void wv_82586_stop(device * dev) static inline void wv_82586_stop(struct net_device * dev)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
...@@ -3680,7 +3680,7 @@ static inline void wv_82586_stop(device * dev) ...@@ -3680,7 +3680,7 @@ static inline void wv_82586_stop(device * dev)
* 5. Start the LAN controller's receive unit * 5. Start the LAN controller's receive unit
* (called by wavelan_interrupt(), wavelan_watchdog() & wavelan_open()) * (called by wavelan_interrupt(), wavelan_watchdog() & wavelan_open())
*/ */
static int wv_hw_reset(device * dev) static int wv_hw_reset(struct net_device * dev)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
...@@ -3770,7 +3770,7 @@ static int wv_check_ioaddr(unsigned long ioaddr, u8 * mac) ...@@ -3770,7 +3770,7 @@ static int wv_check_ioaddr(unsigned long ioaddr, u8 * mac)
*/ */
static irqreturn_t wavelan_interrupt(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t wavelan_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
device *dev; struct net_device *dev;
unsigned long ioaddr; unsigned long ioaddr;
net_local *lp; net_local *lp;
u16 hasr; u16 hasr;
...@@ -3923,7 +3923,7 @@ static irqreturn_t wavelan_interrupt(int irq, void *dev_id, struct pt_regs *regs ...@@ -3923,7 +3923,7 @@ static irqreturn_t wavelan_interrupt(int irq, void *dev_id, struct pt_regs *regs
* kernel. If the transmission completes, this timer is disabled. If * kernel. If the transmission completes, this timer is disabled. If
* the timer expires, we are called and we try to unlock the hardware. * the timer expires, we are called and we try to unlock the hardware.
*/ */
static void wavelan_watchdog(device * dev) static void wavelan_watchdog(struct net_device * dev)
{ {
net_local * lp = (net_local *)dev->priv; net_local * lp = (net_local *)dev->priv;
u_long ioaddr = dev->base_addr; u_long ioaddr = dev->base_addr;
...@@ -4003,7 +4003,7 @@ static void wavelan_watchdog(device * dev) ...@@ -4003,7 +4003,7 @@ static void wavelan_watchdog(device * dev)
* Configure and start up the WaveLAN PCMCIA adaptor. * Configure and start up the WaveLAN PCMCIA adaptor.
* Called by NET3 when it "opens" the device. * Called by NET3 when it "opens" the device.
*/ */
static int wavelan_open(device * dev) static int wavelan_open(struct net_device * dev)
{ {
net_local * lp = (net_local *)dev->priv; net_local * lp = (net_local *)dev->priv;
unsigned long flags; unsigned long flags;
...@@ -4058,7 +4058,7 @@ static int wavelan_open(device * dev) ...@@ -4058,7 +4058,7 @@ static int wavelan_open(device * dev)
* Shut down the WaveLAN ISA card. * Shut down the WaveLAN ISA card.
* Called by NET3 when it "closes" the device. * Called by NET3 when it "closes" the device.
*/ */
static int wavelan_close(device * dev) static int wavelan_close(struct net_device * dev)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
unsigned long flags; unsigned long flags;
...@@ -4091,7 +4091,7 @@ static int wavelan_close(device * dev) ...@@ -4091,7 +4091,7 @@ static int wavelan_close(device * dev)
* device structure * device structure
* (called by wavelan_probe() and via init_module()). * (called by wavelan_probe() and via init_module()).
*/ */
static int __init wavelan_config(device *dev, unsigned short ioaddr) static int __init wavelan_config(struct net_device *dev, unsigned short ioaddr)
{ {
u8 irq_mask; u8 irq_mask;
int irq; int irq;
...@@ -4293,7 +4293,7 @@ struct net_device * __init wavelan_probe(int unit) ...@@ -4293,7 +4293,7 @@ struct net_device * __init wavelan_probe(int unit)
release_region(dev->base_addr, sizeof(ha_t)); release_region(dev->base_addr, sizeof(ha_t));
wavelan_list = wavelan_list->next; wavelan_list = wavelan_list->next;
out: out:
kfree(dev); free_netdev(dev);
return ERR_PTR(r); return ERR_PTR(r);
} }
...@@ -4352,7 +4352,7 @@ int init_module(void) ...@@ -4352,7 +4352,7 @@ int init_module(void)
continue; continue;
} }
} }
kfree(dev); free_netdev(dev);
} }
#ifdef DEBUG_CONFIG_ERROR #ifdef DEBUG_CONFIG_ERROR
...@@ -4379,7 +4379,7 @@ void cleanup_module(void) ...@@ -4379,7 +4379,7 @@ void cleanup_module(void)
/* Loop on all devices and release them. */ /* Loop on all devices and release them. */
while (wavelan_list) { while (wavelan_list) {
device *dev = wavelan_list->dev; struct net_device *dev = wavelan_list->dev;
#ifdef DEBUG_CONFIG_INFO #ifdef DEBUG_CONFIG_INFO
printk(KERN_DEBUG printk(KERN_DEBUG
......
...@@ -469,7 +469,6 @@ static const char *version = "wavelan.c : v24 (SMP + wireless extensions) 11/12/ ...@@ -469,7 +469,6 @@ static const char *version = "wavelan.c : v24 (SMP + wireless extensions) 11/12/
/****************************** TYPES ******************************/ /****************************** TYPES ******************************/
/* Shortcuts */ /* Shortcuts */
typedef struct net_device device;
typedef struct net_device_stats en_stats; typedef struct net_device_stats en_stats;
typedef struct iw_statistics iw_stats; typedef struct iw_statistics iw_stats;
typedef struct iw_quality iw_qual; typedef struct iw_quality iw_qual;
...@@ -492,7 +491,7 @@ typedef u_char mac_addr[WAVELAN_ADDR_SIZE]; /* Hardware address */ ...@@ -492,7 +491,7 @@ typedef u_char mac_addr[WAVELAN_ADDR_SIZE]; /* Hardware address */
struct net_local struct net_local
{ {
net_local * next; /* linked list of the devices */ net_local * next; /* linked list of the devices */
device * dev; /* reverse link */ struct net_device * dev; /* reverse link */
spinlock_t spinlock; /* Serialize access to the hardware (SMP) */ spinlock_t spinlock; /* Serialize access to the hardware (SMP) */
en_stats stats; /* Ethernet interface statistics */ en_stats stats; /* Ethernet interface statistics */
int nresets; /* number of hardware resets */ int nresets; /* number of hardware resets */
...@@ -542,8 +541,8 @@ static inline void ...@@ -542,8 +541,8 @@ static inline void
u_short), /* hacr */ u_short), /* hacr */
wv_16_on(u_long, /* ioaddr */ wv_16_on(u_long, /* ioaddr */
u_short), /* hacr */ u_short), /* hacr */
wv_ints_off(device *), wv_ints_off(struct net_device *),
wv_ints_on(device *); wv_ints_on(struct net_device *);
/* ----------------- MODEM MANAGEMENT SUBROUTINES ----------------- */ /* ----------------- MODEM MANAGEMENT SUBROUTINES ----------------- */
static void static void
psa_read(u_long, /* Read the Parameter Storage Area. */ psa_read(u_long, /* Read the Parameter Storage Area. */
...@@ -592,57 +591,57 @@ static inline void ...@@ -592,57 +591,57 @@ static inline void
u_char *, /* b */ u_char *, /* b */
int); /* n */ int); /* n */
static void static void
wv_ack(device *); wv_ack(struct net_device *);
static inline int static inline int
wv_synchronous_cmd(device *, wv_synchronous_cmd(struct net_device *,
const char *), const char *),
wv_config_complete(device *, wv_config_complete(struct net_device *,
u_long, u_long,
net_local *); net_local *);
static int static int
wv_complete(device *, wv_complete(struct net_device *,
u_long, u_long,
net_local *); net_local *);
static inline void static inline void
wv_82586_reconfig(device *); wv_82586_reconfig(struct net_device *);
/* ------------------- DEBUG & INFO SUBROUTINES ------------------- */ /* ------------------- DEBUG & INFO SUBROUTINES ------------------- */
#ifdef DEBUG_I82586_SHOW #ifdef DEBUG_I82586_SHOW
static void static void
wv_scb_show(unsigned short); wv_scb_show(unsigned short);
#endif #endif
static inline void static inline void
wv_init_info(device *); /* display startup info */ wv_init_info(struct net_device *); /* display startup info */
/* ------------------- IOCTL, STATS & RECONFIG ------------------- */ /* ------------------- IOCTL, STATS & RECONFIG ------------------- */
static en_stats * static en_stats *
wavelan_get_stats(device *); /* Give stats /proc/net/dev */ wavelan_get_stats(struct net_device *); /* Give stats /proc/net/dev */
static void static void
wavelan_set_multicast_list(device *); wavelan_set_multicast_list(struct net_device *);
/* ----------------------- PACKET RECEPTION ----------------------- */ /* ----------------------- PACKET RECEPTION ----------------------- */
static inline void static inline void
wv_packet_read(device *, /* Read a packet from a frame. */ wv_packet_read(struct net_device *, /* Read a packet from a frame. */
u_short, u_short,
int), int),
wv_receive(device *); /* Read all packets waiting. */ wv_receive(struct net_device *); /* Read all packets waiting. */
/* --------------------- PACKET TRANSMISSION --------------------- */ /* --------------------- PACKET TRANSMISSION --------------------- */
static inline int static inline int
wv_packet_write(device *, /* Write a packet to the Tx buffer. */ wv_packet_write(struct net_device *, /* Write a packet to the Tx buffer. */
void *, void *,
short); short);
static int static int
wavelan_packet_xmit(struct sk_buff *, /* Send a packet. */ wavelan_packet_xmit(struct sk_buff *, /* Send a packet. */
device *); struct net_device *);
/* -------------------- HARDWARE CONFIGURATION -------------------- */ /* -------------------- HARDWARE CONFIGURATION -------------------- */
static inline int static inline int
wv_mmc_init(device *), /* Initialize the modem. */ wv_mmc_init(struct net_device *), /* Initialize the modem. */
wv_ru_start(device *), /* Start the i82586 receiver unit. */ wv_ru_start(struct net_device *), /* Start the i82586 receiver unit. */
wv_cu_start(device *), /* Start the i82586 command unit. */ wv_cu_start(struct net_device *), /* Start the i82586 command unit. */
wv_82586_start(device *); /* Start the i82586. */ wv_82586_start(struct net_device *); /* Start the i82586. */
static void static void
wv_82586_config(device *); /* Configure the i82586. */ wv_82586_config(struct net_device *); /* Configure the i82586. */
static inline void static inline void
wv_82586_stop(device *); wv_82586_stop(struct net_device *);
static int static int
wv_hw_reset(device *), /* Reset the WaveLAN hardware. */ wv_hw_reset(struct net_device *), /* Reset the WaveLAN hardware. */
wv_check_ioaddr(u_long, /* ioaddr */ wv_check_ioaddr(u_long, /* ioaddr */
u_char *); /* mac address (read) */ u_char *); /* mac address (read) */
/* ---------------------- INTERRUPT HANDLING ---------------------- */ /* ---------------------- INTERRUPT HANDLING ---------------------- */
...@@ -651,12 +650,12 @@ static irqreturn_t ...@@ -651,12 +650,12 @@ static irqreturn_t
void *, void *,
struct pt_regs *); struct pt_regs *);
static void static void
wavelan_watchdog(device *); /* transmission watchdog */ wavelan_watchdog(struct net_device *); /* transmission watchdog */
/* ------------------- CONFIGURATION CALLBACKS ------------------- */ /* ------------------- CONFIGURATION CALLBACKS ------------------- */
static int static int
wavelan_open(device *), /* Open the device. */ wavelan_open(struct net_device *), /* Open the device. */
wavelan_close(device *), /* Close the device. */ wavelan_close(struct net_device *), /* Close the device. */
wavelan_config(device *, unsigned short);/* Configure one device. */ wavelan_config(struct net_device *, unsigned short);/* Configure one device. */
extern struct net_device *wavelan_probe(int unit); /* See Space.c. */ extern struct net_device *wavelan_probe(int unit); /* See Space.c. */
/**************************** VARIABLES ****************************/ /**************************** VARIABLES ****************************/
......
...@@ -131,7 +131,7 @@ hacr_write_slow(u_long base, ...@@ -131,7 +131,7 @@ hacr_write_slow(u_long base,
* Read the Parameter Storage Area from the WaveLAN card's memory * Read the Parameter Storage Area from the WaveLAN card's memory
*/ */
static void static void
psa_read(device * dev, psa_read(struct net_device * dev,
int o, /* offset in PSA */ int o, /* offset in PSA */
u_char * b, /* buffer to fill */ u_char * b, /* buffer to fill */
int n) /* size to read */ int n) /* size to read */
...@@ -155,7 +155,7 @@ psa_read(device * dev, ...@@ -155,7 +155,7 @@ psa_read(device * dev,
* Write the Paramter Storage Area to the WaveLAN card's memory * Write the Paramter Storage Area to the WaveLAN card's memory
*/ */
static void static void
psa_write(device * dev, psa_write(struct net_device * dev,
int o, /* Offset in psa */ int o, /* Offset in psa */
u_char * b, /* Buffer in memory */ u_char * b, /* Buffer in memory */
int n) /* Length of buffer */ int n) /* Length of buffer */
...@@ -229,7 +229,7 @@ psa_crc(unsigned char * psa, /* The PSA */ ...@@ -229,7 +229,7 @@ psa_crc(unsigned char * psa, /* The PSA */
* update the checksum field in the Wavelan's PSA * update the checksum field in the Wavelan's PSA
*/ */
static void static void
update_psa_checksum(device * dev) update_psa_checksum(struct net_device * dev)
{ {
#ifdef SET_PSA_CRC #ifdef SET_PSA_CRC
psa_t psa; psa_t psa;
...@@ -753,7 +753,7 @@ void wv_roam_handover(wavepoint_history *wavepoint, net_local *lp) ...@@ -753,7 +753,7 @@ void wv_roam_handover(wavepoint_history *wavepoint, net_local *lp)
} }
/* Called when a WavePoint beacon is received */ /* Called when a WavePoint beacon is received */
static inline void wl_roam_gather(device * dev, static inline void wl_roam_gather(struct net_device * dev,
u_char * hdr, /* Beacon header */ u_char * hdr, /* Beacon header */
u_char * stats) /* SNR, Signal quality u_char * stats) /* SNR, Signal quality
of packet */ of packet */
...@@ -831,7 +831,7 @@ static inline int WAVELAN_BEACON(unsigned char *data) ...@@ -831,7 +831,7 @@ static inline int WAVELAN_BEACON(unsigned char *data)
* wv_82593_config() & wv_diag()) * wv_82593_config() & wv_diag())
*/ */
static int static int
wv_82593_cmd(device * dev, wv_82593_cmd(struct net_device * dev,
char * str, char * str,
int cmd, int cmd,
int result) int result)
...@@ -942,7 +942,7 @@ wv_82593_cmd(device * dev, ...@@ -942,7 +942,7 @@ wv_82593_cmd(device * dev,
* status for the WaveLAN. * status for the WaveLAN.
*/ */
static inline int static inline int
wv_diag(device * dev) wv_diag(struct net_device * dev)
{ {
int ret = FALSE; int ret = FALSE;
...@@ -963,7 +963,7 @@ wv_diag(device * dev) ...@@ -963,7 +963,7 @@ wv_diag(device * dev)
* The return value is the address to use for next the call. * The return value is the address to use for next the call.
*/ */
static int static int
read_ringbuf(device * dev, read_ringbuf(struct net_device * dev,
int addr, int addr,
char * buf, char * buf,
int len) int len)
...@@ -1004,10 +1004,10 @@ read_ringbuf(device * dev, ...@@ -1004,10 +1004,10 @@ read_ringbuf(device * dev,
* some delay sometime... * some delay sometime...
*/ */
static inline void static inline void
wv_82593_reconfig(device * dev) wv_82593_reconfig(struct net_device * dev)
{ {
net_local * lp = (net_local *)dev->priv; net_local * lp = (net_local *)dev->priv;
dev_link_t * link = ((net_local *) dev->priv)->link; dev_link_t * link = lp->link;
unsigned long flags; unsigned long flags;
/* Arm the flag, will be cleard in wv_82593_config() */ /* Arm the flag, will be cleard in wv_82593_config() */
...@@ -1132,7 +1132,7 @@ wv_psa_show(psa_t * p) ...@@ -1132,7 +1132,7 @@ wv_psa_show(psa_t * p)
* This function need to be completed... * This function need to be completed...
*/ */
static void static void
wv_mmc_show(device * dev) wv_mmc_show(struct net_device * dev)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local * lp = (net_local *)dev->priv; net_local * lp = (net_local *)dev->priv;
...@@ -1222,7 +1222,7 @@ wv_mmc_show(device * dev) ...@@ -1222,7 +1222,7 @@ wv_mmc_show(device * dev)
* Print the formatted status of the i82593's receive unit. * Print the formatted status of the i82593's receive unit.
*/ */
static void static void
wv_ru_show(device * dev) wv_ru_show(struct net_device * dev)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = (net_local *) dev->priv;
...@@ -1241,7 +1241,7 @@ wv_ru_show(device * dev) ...@@ -1241,7 +1241,7 @@ wv_ru_show(device * dev)
* Print the formatted status of the WaveLAN PCMCIA device driver. * Print the formatted status of the WaveLAN PCMCIA device driver.
*/ */
static void static void
wv_dev_show(device * dev) wv_dev_show(struct net_device * dev)
{ {
printk(KERN_DEBUG "dev:"); printk(KERN_DEBUG "dev:");
printk(" state=%lX,", dev->state); printk(" state=%lX,", dev->state);
...@@ -1256,7 +1256,7 @@ wv_dev_show(device * dev) ...@@ -1256,7 +1256,7 @@ wv_dev_show(device * dev)
* private information. * private information.
*/ */
static void static void
wv_local_show(device * dev) wv_local_show(struct net_device * dev)
{ {
net_local *lp; net_local *lp;
...@@ -1314,7 +1314,7 @@ wv_packet_info(u_char * p, /* Packet to dump */ ...@@ -1314,7 +1314,7 @@ wv_packet_info(u_char * p, /* Packet to dump */
* There is a lot of flag to configure it at your will... * There is a lot of flag to configure it at your will...
*/ */
static inline void static inline void
wv_init_info(device * dev) wv_init_info(struct net_device * dev)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
psa_t psa; psa_t psa;
...@@ -1412,7 +1412,7 @@ wv_init_info(device * dev) ...@@ -1412,7 +1412,7 @@ wv_init_info(device * dev)
* Used when the user read /proc/net/dev * Used when the user read /proc/net/dev
*/ */
static en_stats * static en_stats *
wavelan_get_stats(device * dev) wavelan_get_stats(struct net_device * dev)
{ {
#ifdef DEBUG_IOCTL_TRACE #ifdef DEBUG_IOCTL_TRACE
printk(KERN_DEBUG "%s: <>wavelan_get_stats()\n", dev->name); printk(KERN_DEBUG "%s: <>wavelan_get_stats()\n", dev->name);
...@@ -1431,7 +1431,7 @@ wavelan_get_stats(device * dev) ...@@ -1431,7 +1431,7 @@ wavelan_get_stats(device * dev)
*/ */
static void static void
wavelan_set_multicast_list(device * dev) wavelan_set_multicast_list(struct net_device * dev)
{ {
net_local * lp = (net_local *) dev->priv; net_local * lp = (net_local *) dev->priv;
...@@ -1529,7 +1529,7 @@ wavelan_set_multicast_list(device * dev) ...@@ -1529,7 +1529,7 @@ wavelan_set_multicast_list(device * dev)
*/ */
#ifdef SET_MAC_ADDRESS #ifdef SET_MAC_ADDRESS
static int static int
wavelan_set_mac_address(device * dev, wavelan_set_mac_address(struct net_device * dev,
void * addr) void * addr)
{ {
struct sockaddr * mac = addr; struct sockaddr * mac = addr;
...@@ -1796,7 +1796,7 @@ wv_frequency_list(u_long base, /* i/o port of the card */ ...@@ -1796,7 +1796,7 @@ wv_frequency_list(u_long base, /* i/o port of the card */
* Sorry, but this function really need wireless extensions... * Sorry, but this function really need wireless extensions...
*/ */
static inline void static inline void
wl_spy_gather(device * dev, wl_spy_gather(struct net_device * dev,
u_char * mac, /* MAC address */ u_char * mac, /* MAC address */
u_char * stats) /* Statistics to gather */ u_char * stats) /* Statistics to gather */
{ {
...@@ -1823,7 +1823,7 @@ wl_spy_gather(device * dev, ...@@ -1823,7 +1823,7 @@ wl_spy_gather(device * dev,
* or you may also calculate the mean and standard deviation of the level... * or you may also calculate the mean and standard deviation of the level...
*/ */
static inline void static inline void
wl_his_gather(device * dev, wl_his_gather(struct net_device * dev,
u_char * stats) /* Statistics to gather */ u_char * stats) /* Statistics to gather */
{ {
net_local * lp = (net_local *) dev->priv; net_local * lp = (net_local *) dev->priv;
...@@ -2785,7 +2785,7 @@ wavelan_ioctl(struct net_device * dev, /* Device on wich the ioctl apply */ ...@@ -2785,7 +2785,7 @@ wavelan_ioctl(struct net_device * dev, /* Device on wich the ioctl apply */
* Called by /proc/net/wireless... * Called by /proc/net/wireless...
*/ */
static iw_stats * static iw_stats *
wavelan_get_wireless_stats(device * dev) wavelan_get_wireless_stats(struct net_device * dev)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local * lp = (net_local *) dev->priv; net_local * lp = (net_local *) dev->priv;
...@@ -2847,7 +2847,7 @@ wavelan_get_wireless_stats(device * dev) ...@@ -2847,7 +2847,7 @@ wavelan_get_wireless_stats(device * dev)
* (called by wv_packet_rcv()) * (called by wv_packet_rcv())
*/ */
static inline int static inline int
wv_start_of_frame(device * dev, wv_start_of_frame(struct net_device * dev,
int rfp, /* end of frame */ int rfp, /* end of frame */
int wrap) /* start of buffer */ int wrap) /* start of buffer */
{ {
...@@ -2909,7 +2909,7 @@ wv_start_of_frame(device * dev, ...@@ -2909,7 +2909,7 @@ wv_start_of_frame(device * dev,
* (called by wv_packet_rcv()) * (called by wv_packet_rcv())
*/ */
static inline void static inline void
wv_packet_read(device * dev, wv_packet_read(struct net_device * dev,
int fd_p, int fd_p,
int sksize) int sksize)
{ {
...@@ -3012,7 +3012,7 @@ wv_packet_read(device * dev, ...@@ -3012,7 +3012,7 @@ wv_packet_read(device * dev,
* Note : the spinlock is already grabbed for us and irq are disabled. * Note : the spinlock is already grabbed for us and irq are disabled.
*/ */
static inline void static inline void
wv_packet_rcv(device * dev) wv_packet_rcv(struct net_device * dev)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local * lp = (net_local *) dev->priv; net_local * lp = (net_local *) dev->priv;
...@@ -3146,7 +3146,7 @@ wv_packet_rcv(device * dev) ...@@ -3146,7 +3146,7 @@ wv_packet_rcv(device * dev)
* (called in wavelan_packet_xmit()) * (called in wavelan_packet_xmit())
*/ */
static inline void static inline void
wv_packet_write(device * dev, wv_packet_write(struct net_device * dev,
void * buf, void * buf,
short length) short length)
{ {
...@@ -3209,7 +3209,7 @@ wv_packet_write(device * dev, ...@@ -3209,7 +3209,7 @@ wv_packet_write(device * dev,
*/ */
static int static int
wavelan_packet_xmit(struct sk_buff * skb, wavelan_packet_xmit(struct sk_buff * skb,
device * dev) struct net_device * dev)
{ {
net_local * lp = (net_local *)dev->priv; net_local * lp = (net_local *)dev->priv;
unsigned long flags; unsigned long flags;
...@@ -3273,7 +3273,7 @@ wavelan_packet_xmit(struct sk_buff * skb, ...@@ -3273,7 +3273,7 @@ wavelan_packet_xmit(struct sk_buff * skb,
* (called by wv_hw_config()) * (called by wv_hw_config())
*/ */
static inline int static inline int
wv_mmc_init(device * dev) wv_mmc_init(struct net_device * dev)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
psa_t psa; psa_t psa;
...@@ -3467,7 +3467,7 @@ wv_mmc_init(device * dev) ...@@ -3467,7 +3467,7 @@ wv_mmc_init(device * dev)
* (called in wv_ru_start() and wavelan_close() and wavelan_event()) * (called in wv_ru_start() and wavelan_close() and wavelan_event())
*/ */
static int static int
wv_ru_stop(device * dev) wv_ru_stop(struct net_device * dev)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local * lp = (net_local *) dev->priv; net_local * lp = (net_local *) dev->priv;
...@@ -3530,7 +3530,7 @@ wv_ru_stop(device * dev) ...@@ -3530,7 +3530,7 @@ wv_ru_stop(device * dev)
* (called in wv_hw_reset() & wavelan_open()) * (called in wv_hw_reset() & wavelan_open())
*/ */
static int static int
wv_ru_start(device * dev) wv_ru_start(struct net_device * dev)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local * lp = (net_local *) dev->priv; net_local * lp = (net_local *) dev->priv;
...@@ -3618,7 +3618,7 @@ wv_ru_start(device * dev) ...@@ -3618,7 +3618,7 @@ wv_ru_start(device * dev)
* (called by wv_hw_config(), wv_82593_reconfig() & wavelan_packet_xmit()) * (called by wv_hw_config(), wv_82593_reconfig() & wavelan_packet_xmit())
*/ */
static int static int
wv_82593_config(device * dev) wv_82593_config(struct net_device * dev)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local * lp = (net_local *) dev->priv; net_local * lp = (net_local *) dev->priv;
...@@ -3792,7 +3792,7 @@ wv_82593_config(device * dev) ...@@ -3792,7 +3792,7 @@ wv_82593_config(device * dev)
* (called by wv_config()) * (called by wv_config())
*/ */
static inline int static inline int
wv_pcmcia_reset(device * dev) wv_pcmcia_reset(struct net_device * dev)
{ {
int i; int i;
conf_reg_t reg = { 0, CS_READ, CISREG_COR, 0 }; conf_reg_t reg = { 0, CS_READ, CISREG_COR, 0 };
...@@ -3854,7 +3854,7 @@ wv_pcmcia_reset(device * dev) ...@@ -3854,7 +3854,7 @@ wv_pcmcia_reset(device * dev)
* (called by wavelan_event() & wv_hw_reset()) * (called by wavelan_event() & wv_hw_reset())
*/ */
static int static int
wv_hw_config(device * dev) wv_hw_config(struct net_device * dev)
{ {
net_local * lp = (net_local *) dev->priv; net_local * lp = (net_local *) dev->priv;
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
...@@ -3961,7 +3961,7 @@ wv_hw_config(device * dev) ...@@ -3961,7 +3961,7 @@ wv_hw_config(device * dev)
* (called by wavelan_event(), wavelan_watchdog() and wavelan_open()) * (called by wavelan_event(), wavelan_watchdog() and wavelan_open())
*/ */
static inline void static inline void
wv_hw_reset(device * dev) wv_hw_reset(struct net_device * dev)
{ {
net_local * lp = (net_local *) dev->priv; net_local * lp = (net_local *) dev->priv;
...@@ -4004,7 +4004,7 @@ wv_pcmcia_config(dev_link_t * link) ...@@ -4004,7 +4004,7 @@ wv_pcmcia_config(dev_link_t * link)
memreq_t mem; memreq_t mem;
handle = link->handle; handle = link->handle;
dev = (device *) link->priv; dev = (struct net_device *) link->priv;
#ifdef DEBUG_CONFIG_TRACE #ifdef DEBUG_CONFIG_TRACE
printk(KERN_DEBUG "->wv_pcmcia_config(0x%p)\n", link); printk(KERN_DEBUG "->wv_pcmcia_config(0x%p)\n", link);
...@@ -4150,7 +4150,7 @@ wv_pcmcia_config(dev_link_t * link) ...@@ -4150,7 +4150,7 @@ wv_pcmcia_config(dev_link_t * link)
static void static void
wv_pcmcia_release(dev_link_t *link) wv_pcmcia_release(dev_link_t *link)
{ {
device * dev = (device *) link->priv; struct net_device * dev = (struct net_device *) link->priv;
#ifdef DEBUG_CONFIG_TRACE #ifdef DEBUG_CONFIG_TRACE
printk(KERN_DEBUG "%s: -> wv_pcmcia_release(0x%p)\n", dev->name, link); printk(KERN_DEBUG "%s: -> wv_pcmcia_release(0x%p)\n", dev->name, link);
...@@ -4200,13 +4200,13 @@ wavelan_interrupt(int irq, ...@@ -4200,13 +4200,13 @@ wavelan_interrupt(int irq,
void * dev_id, void * dev_id,
struct pt_regs * regs) struct pt_regs * regs)
{ {
device * dev; struct net_device * dev;
net_local * lp; net_local * lp;
ioaddr_t base; ioaddr_t base;
int status0; int status0;
u_int tx_status; u_int tx_status;
if((dev = (device *)dev_id) == (device *) NULL) if ((dev = dev_id) == NULL)
{ {
#ifdef DEBUG_INTERRUPT_ERROR #ifdef DEBUG_INTERRUPT_ERROR
printk(KERN_WARNING "wavelan_interrupt(): irq %d for unknown device.\n", printk(KERN_WARNING "wavelan_interrupt(): irq %d for unknown device.\n",
...@@ -4467,7 +4467,7 @@ wavelan_interrupt(int irq, ...@@ -4467,7 +4467,7 @@ wavelan_interrupt(int irq,
* deal with the multiple Tx buffers... * deal with the multiple Tx buffers...
*/ */
static void static void
wavelan_watchdog(device * dev) wavelan_watchdog(struct net_device * dev)
{ {
net_local * lp = (net_local *) dev->priv; net_local * lp = (net_local *) dev->priv;
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
...@@ -4542,7 +4542,7 @@ wavelan_watchdog(device * dev) ...@@ -4542,7 +4542,7 @@ wavelan_watchdog(device * dev)
* Called by NET3 when it "open" the device. * Called by NET3 when it "open" the device.
*/ */
static int static int
wavelan_open(device * dev) wavelan_open(struct net_device * dev)
{ {
dev_link_t * link = ((net_local *) dev->priv)->link; dev_link_t * link = ((net_local *) dev->priv)->link;
net_local * lp = (net_local *)dev->priv; net_local * lp = (net_local *)dev->priv;
...@@ -4597,7 +4597,7 @@ wavelan_open(device * dev) ...@@ -4597,7 +4597,7 @@ wavelan_open(device * dev)
* Called by NET3 when it "close" the device. * Called by NET3 when it "close" the device.
*/ */
static int static int
wavelan_close(device * dev) wavelan_close(struct net_device * dev)
{ {
dev_link_t * link = ((net_local *) dev->priv)->link; dev_link_t * link = ((net_local *) dev->priv)->link;
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
...@@ -4661,7 +4661,7 @@ wavelan_attach(void) ...@@ -4661,7 +4661,7 @@ wavelan_attach(void)
{ {
client_reg_t client_reg; /* Register with cardmgr */ client_reg_t client_reg; /* Register with cardmgr */
dev_link_t * link; /* Info for cardmgr */ dev_link_t * link; /* Info for cardmgr */
device * dev; /* Interface generic data */ struct net_device * dev; /* Interface generic data */
net_local * lp; /* Interface specific data */ net_local * lp; /* Interface specific data */
int i, ret; int i, ret;
...@@ -4699,22 +4699,14 @@ wavelan_attach(void) ...@@ -4699,22 +4699,14 @@ wavelan_attach(void)
dev_list = link; dev_list = link;
/* Allocate the generic data structure */ /* Allocate the generic data structure */
dev = kmalloc(sizeof(struct net_device), GFP_KERNEL); dev = alloc_etherdev(sizeof(net_local));
if (!dev) { if (!dev) {
kfree(link); kfree(link);
return NULL; return NULL;
} }
memset(dev, 0x00, sizeof(struct net_device));
link->priv = link->irq.Instance = dev; link->priv = link->irq.Instance = dev;
/* Allocate the wavelan-specific data structure. */ lp = dev->priv;
dev->priv = lp = (net_local *) kmalloc(sizeof(net_local), GFP_KERNEL);
if (!lp) {
kfree(link);
kfree(dev);
return NULL;
}
memset(lp, 0x00, sizeof(net_local));
/* Init specific data */ /* Init specific data */
lp->configured = 0; lp->configured = 0;
...@@ -4732,9 +4724,6 @@ wavelan_attach(void) ...@@ -4732,9 +4724,6 @@ wavelan_attach(void)
lp->link = link; lp->link = link;
lp->dev = dev; lp->dev = dev;
/* Standard setup for generic data */
ether_setup(dev);
/* wavelan NET3 callbacks */ /* wavelan NET3 callbacks */
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
dev->open = &wavelan_open; dev->open = &wavelan_open;
...@@ -4852,22 +4841,16 @@ wavelan_detach(dev_link_t * link) ...@@ -4852,22 +4841,16 @@ wavelan_detach(dev_link_t * link)
/* Free pieces */ /* Free pieces */
if(link->priv) if(link->priv)
{ {
device * dev = (device *) link->priv; struct net_device * dev = (struct net_device *) link->priv;
/* Remove ourselves from the kernel list of ethernet devices */ /* Remove ourselves from the kernel list of ethernet devices */
/* Warning : can't be called from interrupt, timer or wavelan_close() */ /* Warning : can't be called from interrupt, timer or wavelan_close() */
if(link->dev != NULL) if (link->dev)
unregister_netdev(dev); unregister_netdev(dev);
link->dev = NULL; link->dev = NULL;
((net_local *) dev->priv)->link = NULL;
if(dev->priv) ((net_local *) dev->priv)->dev = NULL;
{ free_netdev(dev);
/* Sound strange, but safe... */
((net_local *) dev->priv)->link = (dev_link_t *) NULL;
((net_local *) dev->priv)->dev = (device *) NULL;
kfree(dev->priv);
}
kfree(link->priv);
} }
kfree(link); kfree(link);
...@@ -4889,7 +4872,7 @@ wavelan_event(event_t event, /* The event received */ ...@@ -4889,7 +4872,7 @@ wavelan_event(event_t event, /* The event received */
event_callback_args_t * args) event_callback_args_t * args)
{ {
dev_link_t * link = (dev_link_t *) args->client_data; dev_link_t * link = (dev_link_t *) args->client_data;
device * dev = (device *) link->priv; struct net_device * dev = (struct net_device *) link->priv;
#ifdef DEBUG_CALLBACK_TRACE #ifdef DEBUG_CALLBACK_TRACE
printk(KERN_DEBUG "->wavelan_event(): %s\n", printk(KERN_DEBUG "->wavelan_event(): %s\n",
......
...@@ -588,7 +588,6 @@ struct wavepoint_table ...@@ -588,7 +588,6 @@ struct wavepoint_table
/****************************** TYPES ******************************/ /****************************** TYPES ******************************/
/* Shortcuts */ /* Shortcuts */
typedef struct net_device device;
typedef struct net_device_stats en_stats; typedef struct net_device_stats en_stats;
typedef struct iw_statistics iw_stats; typedef struct iw_statistics iw_stats;
typedef struct iw_quality iw_qual; typedef struct iw_quality iw_qual;
...@@ -611,7 +610,7 @@ typedef u_char mac_addr[WAVELAN_ADDR_SIZE]; /* Hardware address */ ...@@ -611,7 +610,7 @@ typedef u_char mac_addr[WAVELAN_ADDR_SIZE]; /* Hardware address */
struct net_local struct net_local
{ {
dev_node_t node; /* ???? What is this stuff ???? */ dev_node_t node; /* ???? What is this stuff ???? */
device * dev; /* Reverse link... */ struct net_device * dev; /* Reverse link... */
spinlock_t spinlock; /* Serialize access to the hardware (SMP) */ spinlock_t spinlock; /* Serialize access to the hardware (SMP) */
dev_link_t * link; /* pcmcia structure */ dev_link_t * link; /* pcmcia structure */
en_stats stats; /* Ethernet interface statistics */ en_stats stats; /* Ethernet interface statistics */
...@@ -673,11 +672,11 @@ static inline void ...@@ -673,11 +672,11 @@ static inline void
hacr_write_slow(u_long, hacr_write_slow(u_long,
u_char); u_char);
static void static void
psa_read(device *, /* Read the Parameter Storage Area */ psa_read(struct net_device *, /* Read the Parameter Storage Area */
int, /* offset in PSA */ int, /* offset in PSA */
u_char *, /* buffer to fill */ u_char *, /* buffer to fill */
int), /* size to read */ int), /* size to read */
psa_write(device *, /* Write to the PSA */ psa_write(struct net_device *, /* Write to the PSA */
int, /* Offset in psa */ int, /* Offset in psa */
u_char *, /* Buffer in memory */ u_char *, /* Buffer in memory */
int); /* Length of buffer */ int); /* Length of buffer */
...@@ -707,57 +706,57 @@ static void ...@@ -707,57 +706,57 @@ static void
int); /* number of registers */ int); /* number of registers */
/* ---------------------- I82593 SUBROUTINES ----------------------- */ /* ---------------------- I82593 SUBROUTINES ----------------------- */
static int static int
wv_82593_cmd(device *, /* synchronously send a command to i82593 */ wv_82593_cmd(struct net_device *, /* synchronously send a command to i82593 */
char *, char *,
int, int,
int); int);
static inline int static inline int
wv_diag(device *); /* Diagnostique the i82593 */ wv_diag(struct net_device *); /* Diagnostique the i82593 */
static int static int
read_ringbuf(device *, /* Read a receive buffer */ read_ringbuf(struct net_device *, /* Read a receive buffer */
int, int,
char *, char *,
int); int);
static inline void static inline void
wv_82593_reconfig(device *); /* Reconfigure the controller */ wv_82593_reconfig(struct net_device *); /* Reconfigure the controller */
/* ------------------- DEBUG & INFO SUBROUTINES ------------------- */ /* ------------------- DEBUG & INFO SUBROUTINES ------------------- */
static inline void static inline void
wv_init_info(device *); /* display startup info */ wv_init_info(struct net_device *); /* display startup info */
/* ------------------- IOCTL, STATS & RECONFIG ------------------- */ /* ------------------- IOCTL, STATS & RECONFIG ------------------- */
static en_stats * static en_stats *
wavelan_get_stats(device *); /* Give stats /proc/net/dev */ wavelan_get_stats(struct net_device *); /* Give stats /proc/net/dev */
/* ----------------------- PACKET RECEPTION ----------------------- */ /* ----------------------- PACKET RECEPTION ----------------------- */
static inline int static inline int
wv_start_of_frame(device *, /* Seek beggining of current frame */ wv_start_of_frame(struct net_device *, /* Seek beggining of current frame */
int, /* end of frame */ int, /* end of frame */
int); /* start of buffer */ int); /* start of buffer */
static inline void static inline void
wv_packet_read(device *, /* Read a packet from a frame */ wv_packet_read(struct net_device *, /* Read a packet from a frame */
int, int,
int), int),
wv_packet_rcv(device *); /* Read all packets waiting */ wv_packet_rcv(struct net_device *); /* Read all packets waiting */
/* --------------------- PACKET TRANSMISSION --------------------- */ /* --------------------- PACKET TRANSMISSION --------------------- */
static inline void static inline void
wv_packet_write(device *, /* Write a packet to the Tx buffer */ wv_packet_write(struct net_device *, /* Write a packet to the Tx buffer */
void *, void *,
short); short);
static int static int
wavelan_packet_xmit(struct sk_buff *, /* Send a packet */ wavelan_packet_xmit(struct sk_buff *, /* Send a packet */
device *); struct net_device *);
/* -------------------- HARDWARE CONFIGURATION -------------------- */ /* -------------------- HARDWARE CONFIGURATION -------------------- */
static inline int static inline int
wv_mmc_init(device *); /* Initialize the modem */ wv_mmc_init(struct net_device *); /* Initialize the modem */
static int static int
wv_ru_stop(device *), /* Stop the i82593 receiver unit */ wv_ru_stop(struct net_device *), /* Stop the i82593 receiver unit */
wv_ru_start(device *); /* Start the i82593 receiver unit */ wv_ru_start(struct net_device *); /* Start the i82593 receiver unit */
static int static int
wv_82593_config(device *); /* Configure the i82593 */ wv_82593_config(struct net_device *); /* Configure the i82593 */
static inline int static inline int
wv_pcmcia_reset(device *); /* Reset the pcmcia interface */ wv_pcmcia_reset(struct net_device *); /* Reset the pcmcia interface */
static int static int
wv_hw_config(device *); /* Reset & configure the whole hardware */ wv_hw_config(struct net_device *); /* Reset & configure the whole hardware */
static inline void static inline void
wv_hw_reset(device *); /* Same, + start receiver unit */ wv_hw_reset(struct net_device *); /* Same, + start receiver unit */
static inline int static inline int
wv_pcmcia_config(dev_link_t *); /* Configure the pcmcia interface */ wv_pcmcia_config(dev_link_t *); /* Configure the pcmcia interface */
static void static void
...@@ -768,11 +767,11 @@ static irqreturn_t ...@@ -768,11 +767,11 @@ static irqreturn_t
void *, void *,
struct pt_regs *); struct pt_regs *);
static void static void
wavelan_watchdog(device *); /* Transmission watchdog */ wavelan_watchdog(struct net_device *); /* Transmission watchdog */
/* ------------------- CONFIGURATION CALLBACKS ------------------- */ /* ------------------- CONFIGURATION CALLBACKS ------------------- */
static int static int
wavelan_open(device *), /* Open the device */ wavelan_open(struct net_device *), /* Open the device */
wavelan_close(device *); /* Close the device */ wavelan_close(struct net_device *); /* Close the device */
static dev_link_t * static dev_link_t *
wavelan_attach(void); /* Create a new device */ wavelan_attach(void); /* Create a new device */
static void static void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment