git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
drivers
/
net
/
wireless
/
wavelan.c
diff --git
a/drivers/net/wireless/wavelan.c
b/drivers/net/wireless/wavelan.c
index
7a5e20a
..
24221e4
100644
(file)
--- a/
drivers/net/wireless/wavelan.c
+++ b/
drivers/net/wireless/wavelan.c
@@
-102,7
+102,7
@@
static inline void hacr_write(unsigned long ioaddr, u16 hacr)
* Write to card's Host Adapter Command Register. Include a delay for
* those times when it is needed.
*/
* Write to card's Host Adapter Command Register. Include a delay for
* those times when it is needed.
*/
-static
inline
void hacr_write_slow(unsigned long ioaddr, u16 hacr)
+static void hacr_write_slow(unsigned long ioaddr, u16 hacr)
{
hacr_write(ioaddr, hacr);
/* delay might only be needed sometimes */
{
hacr_write(ioaddr, hacr);
/* delay might only be needed sometimes */
@@
-242,7
+242,7
@@
static void psa_write(unsigned long ioaddr, u16 hacr, int o, /* Offset in PSA */
* The Windows drivers don't use the CRC, but the AP and the PtP tool
* depend on it.
*/
* The Windows drivers don't use the CRC, but the AP and the PtP tool
* depend on it.
*/
-static
inline u16 psa_crc(u8 * psa,
/* The PSA */
+static
u16 psa_crc(u8 * psa,
/* The PSA */
int size)
{ /* Number of short for CRC */
int byte_cnt; /* Loop on the PSA */
int size)
{ /* Number of short for CRC */
int byte_cnt; /* Loop on the PSA */
@@
-310,7
+310,7
@@
static void update_psa_checksum(struct net_device * dev, unsigned long ioaddr, u
/*
* Write 1 byte to the MMC.
*/
/*
* Write 1 byte to the MMC.
*/
-static
inline
void mmc_out(unsigned long ioaddr, u16 o, u8 d)
+static void mmc_out(unsigned long ioaddr, u16 o, u8 d)
{
int count = 0;
{
int count = 0;
@@
-326,7
+326,7
@@
static inline void mmc_out(unsigned long ioaddr, u16 o, u8 d)
* Routine to write bytes to the Modem Management Controller.
* We start at the end because it is the way it should be!
*/
* Routine to write bytes to the Modem Management Controller.
* We start at the end because it is the way it should be!
*/
-static
inline
void mmc_write(unsigned long ioaddr, u8 o, u8 * b, int n)
+static void mmc_write(unsigned long ioaddr, u8 o, u8 * b, int n)
{
o += n;
b += n;
{
o += n;
b += n;
@@
-340,7
+340,7
@@
static inline void mmc_write(unsigned long ioaddr, u8 o, u8 * b, int n)
* Read a byte from the MMC.
* Optimised version for 1 byte, avoid using memory.
*/
* Read a byte from the MMC.
* Optimised version for 1 byte, avoid using memory.
*/
-static
inline
u8 mmc_in(unsigned long ioaddr, u16 o)
+static u8 mmc_in(unsigned long ioaddr, u16 o)
{
int count = 0;
{
int count = 0;
@@
-430,7
+430,6
@@
static void fee_read(unsigned long ioaddr, /* I/O port of the card */
}
}
}
}
-#ifdef WIRELESS_EXT /* if the wireless extension exists in the kernel */
/*------------------------------------------------------------------*/
/*
/*------------------------------------------------------------------*/
/*
@@
-514,7
+513,6
@@
static void fee_write(unsigned long ioaddr, /* I/O port of the card */
fee_wait(ioaddr, 10, 100);
#endif /* EEPROM_IS_PROTECTED */
}
fee_wait(ioaddr, 10, 100);
#endif /* EEPROM_IS_PROTECTED */
}
-#endif /* WIRELESS_EXT */
/************************ I82586 SUBROUTINES *************************/
/*
/************************ I82586 SUBROUTINES *************************/
/*
@@
-589,7
+587,7
@@
static void wv_ack(struct net_device * dev)
* Set channel attention bit and busy wait until command has
* completed, then acknowledge completion of the command.
*/
* Set channel attention bit and busy wait until command has
* completed, then acknowledge completion of the command.
*/
-static in
line in
t wv_synchronous_cmd(struct net_device * dev, const char *str)
+static int wv_synchronous_cmd(struct net_device * dev, const char *str)
{
net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr;
{
net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr;
@@
-635,7
+633,7
@@
static inline int wv_synchronous_cmd(struct net_device * dev, const char *str)
* Configuration commands completion interrupt.
* Check if done, and if OK.
*/
* Configuration commands completion interrupt.
* Check if done, and if OK.
*/
-static in
line in
t
+static int
wv_config_complete(struct net_device * dev, unsigned long ioaddr, net_local * lp)
{
unsigned short mcs_addr;
wv_config_complete(struct net_device * dev, unsigned long ioaddr, net_local * lp)
{
unsigned short mcs_addr;
@@
-845,7
+843,7
@@
if (lp->tx_n_in_use > 0)
* wavelan_interrupt is not an option), so you may experience
* delays sometimes.
*/
* wavelan_interrupt is not an option), so you may experience
* delays sometimes.
*/
-static
inline
void wv_82586_reconfig(struct net_device * dev)
+static void wv_82586_reconfig(struct net_device * dev)
{
net_local *lp = (net_local *) dev->priv;
unsigned long flags;
{
net_local *lp = (net_local *) dev->priv;
unsigned long flags;
@@
-973,11
+971,9
@@
static void wv_mmc_show(struct net_device * dev)
mmc_read(ioaddr, 0, (u8 *) & m, sizeof(m));
mmc_out(ioaddr, mmwoff(0, mmw_freeze), 0);
mmc_read(ioaddr, 0, (u8 *) & m, sizeof(m));
mmc_out(ioaddr, mmwoff(0, mmw_freeze), 0);
-#ifdef WIRELESS_EXT /* if wireless extension exists in the kernel */
/* Don't forget to update statistics */
lp->wstats.discard.nwid +=
(m.mmr_wrong_nwid_h << 8) | m.mmr_wrong_nwid_l;
/* Don't forget to update statistics */
lp->wstats.discard.nwid +=
(m.mmr_wrong_nwid_h << 8) | m.mmr_wrong_nwid_l;
-#endif /* WIRELESS_EXT */
printk(KERN_DEBUG "##### WaveLAN modem status registers: #####\n");
#ifdef DEBUG_SHOW_UNUSED
printk(KERN_DEBUG "##### WaveLAN modem status registers: #####\n");
#ifdef DEBUG_SHOW_UNUSED
@@
-1285,7
+1281,7
@@
static inline void wv_packet_info(u8 * p, /* Packet to dump */
* This is the information which is displayed by the driver at startup.
* There are lots of flags for configuring it to your liking.
*/
* This is the information which is displayed by the driver at startup.
* There are lots of flags for configuring it to your liking.
*/
-static
inline
void wv_init_info(struct net_device * dev)
+static void wv_init_info(struct net_device * dev)
{
short ioaddr = dev->base_addr;
net_local *lp = (net_local *) dev->priv;
{
short ioaddr = dev->base_addr;
net_local *lp = (net_local *) dev->priv;
@@
-1499,7
+1495,6
@@
static int wavelan_set_mac_address(struct net_device * dev, void *addr)
}
#endif /* SET_MAC_ADDRESS */
}
#endif /* SET_MAC_ADDRESS */
-#ifdef WIRELESS_EXT /* if wireless extensions exist in the kernel */
/*------------------------------------------------------------------*/
/*
/*------------------------------------------------------------------*/
/*
@@
-1507,7
+1502,7
@@
static int wavelan_set_mac_address(struct net_device * dev, void *addr)
* It's a bit complicated and you don't really want to look into it.
* (called in wavelan_ioctl)
*/
* It's a bit complicated and you don't really want to look into it.
* (called in wavelan_ioctl)
*/
-static in
line int wv_set_frequency(unsigned long ioaddr,
/* I/O port of the card */
+static in
t wv_set_frequency(unsigned long ioaddr,
/* I/O port of the card */
iw_freq * frequency)
{
const int BAND_NUM = 10; /* Number of bands */
iw_freq * frequency)
{
const int BAND_NUM = 10; /* Number of bands */
@@
-1682,7
+1677,7
@@
static inline int wv_set_frequency(unsigned long ioaddr, /* I/O port of the card
/*
* Give the list of available frequencies.
*/
/*
* Give the list of available frequencies.
*/
-static in
line int wv_frequency_list(unsigned long ioaddr,
/* I/O port of the card */
+static in
t wv_frequency_list(unsigned long ioaddr,
/* I/O port of the card */
iw_freq * list, /* List of frequencies to fill */
int max)
{ /* Maximum number of frequencies */
iw_freq * list, /* List of frequencies to fill */
int max)
{ /* Maximum number of frequencies */
@@
-1700,8
+1695,8
@@
static inline int wv_frequency_list(unsigned long ioaddr, /* I/O port of the car
/* Look in the table if the frequency is allowed */
if (table[9 - (freq / 16)] & (1 << (freq % 16))) {
/* Compute approximate channel number */
/* Look in the table if the frequency is allowed */
if (table[9 - (freq / 16)] & (1 << (freq % 16))) {
/* Compute approximate channel number */
- while ((
((channel_bands[c] >> 1) - 24) < freq
) &&
- (c < NELS(channel_bands)))
+ while ((
c < NELS(channel_bands)
) &&
+ (((channel_bands[c] >> 1) - 24) < freq))
c++;
list[i].i = c; /* Set the list index */
c++;
list[i].i = c; /* Set the list index */
@@
-2473,7
+2468,6
@@
static iw_stats *wavelan_get_wireless_stats(struct net_device * dev)
#endif
return &lp->wstats;
}
#endif
return &lp->wstats;
}
-#endif /* WIRELESS_EXT */
/************************* PACKET RECEPTION *************************/
/*
/************************* PACKET RECEPTION *************************/
/*
@@
-2495,7
+2489,7
@@
static iw_stats *wavelan_get_wireless_stats(struct net_device * dev)
* Note: if any errors occur, the packet is "dropped on the floor".
* (called by wv_packet_rcv())
*/
* Note: if any errors occur, the packet is "dropped on the floor".
* (called by wv_packet_rcv())
*/
-static
inline
void
+static void
wv_packet_read(struct net_device * dev, u16 buf_off, int sksize)
{
net_local *lp = (net_local *) dev->priv;
wv_packet_read(struct net_device * dev, u16 buf_off, int sksize)
{
net_local *lp = (net_local *) dev->priv;
@@
-2591,7
+2585,7
@@
wv_packet_read(struct net_device * dev, u16 buf_off, int sksize)
* (called in wavelan_interrupt()).
* Note : the spinlock is already grabbed for us.
*/
* (called in wavelan_interrupt()).
* Note : the spinlock is already grabbed for us.
*/
-static
inline
void wv_receive(struct net_device * dev)
+static void wv_receive(struct net_device * dev)
{
unsigned long ioaddr = dev->base_addr;
net_local *lp = (net_local *) dev->priv;
{
unsigned long ioaddr = dev->base_addr;
net_local *lp = (net_local *) dev->priv;
@@
-2774,7
+2768,7
@@
static inline void wv_receive(struct net_device * dev)
*
* (called in wavelan_packet_xmit())
*/
*
* (called in wavelan_packet_xmit())
*/
-static in
line in
t wv_packet_write(struct net_device * dev, void *buf, short length)
+static int wv_packet_write(struct net_device * dev, void *buf, short length)
{
net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr;
{
net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr;
@@
-2909,6
+2903,7
@@
static int wavelan_packet_xmit(struct sk_buff *skb, struct net_device * dev)
{
net_local *lp = (net_local *) dev->priv;
unsigned long flags;
{
net_local *lp = (net_local *) dev->priv;
unsigned long flags;
+ char data[ETH_ZLEN];
#ifdef DEBUG_TX_TRACE
printk(KERN_DEBUG "%s: ->wavelan_packet_xmit(0x%X)\n", dev->name,
#ifdef DEBUG_TX_TRACE
printk(KERN_DEBUG "%s: ->wavelan_packet_xmit(0x%X)\n", dev->name,
@@
-2943,15
+2938,16
@@
static int wavelan_packet_xmit(struct sk_buff *skb, struct net_device * dev)
* able to detect collisions, therefore in theory we don't really
* need to pad. Jean II */
if (skb->len < ETH_ZLEN) {
* able to detect collisions, therefore in theory we don't really
* need to pad. Jean II */
if (skb->len < ETH_ZLEN) {
- skb = skb_padto(skb, ETH_ZLEN);
- if (skb == NULL)
- return 0;
+ memset(data, 0, ETH_ZLEN);
+ memcpy(data, skb->data, skb->len);
+ /* Write packet on the card */
+ if(wv_packet_write(dev, data, ETH_ZLEN))
+ return 1; /* We failed */
}
}
-
- /* Write packet on the card */
- if(wv_packet_write(dev, skb->data, skb->len))
+ else if(wv_packet_write(dev, skb->data, skb->len))
return 1; /* We failed */
return 1; /* We failed */
+
dev_kfree_skb(skb);
#ifdef DEBUG_TX_TRACE
dev_kfree_skb(skb);
#ifdef DEBUG_TX_TRACE
@@
-2970,7
+2966,7
@@
static int wavelan_packet_xmit(struct sk_buff *skb, struct net_device * dev)
* Routine to initialize the Modem Management Controller.
* (called by wv_hw_reset())
*/
* Routine to initialize the Modem Management Controller.
* (called by wv_hw_reset())
*/
-static in
line in
t wv_mmc_init(struct net_device * dev)
+static int wv_mmc_init(struct net_device * dev)
{
unsigned long ioaddr = dev->base_addr;
net_local *lp = (net_local *) dev->priv;
{
unsigned long ioaddr = dev->base_addr;
net_local *lp = (net_local *) dev->priv;
@@
-3142,7
+3138,7
@@
static inline int wv_mmc_init(struct net_device * dev)
* Start the receive unit.
* (called by wv_hw_reset())
*/
* Start the receive unit.
* (called by wv_hw_reset())
*/
-static in
line in
t wv_ru_start(struct net_device * dev)
+static int wv_ru_start(struct net_device * dev)
{
net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr;
{
net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr;
@@
-3234,7
+3230,7
@@
static inline int wv_ru_start(struct net_device * dev)
*
* (called by wv_hw_reset())
*/
*
* (called by wv_hw_reset())
*/
-static in
line in
t wv_cu_start(struct net_device * dev)
+static int wv_cu_start(struct net_device * dev)
{
net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr;
{
net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr;
@@
-3335,7
+3331,7
@@
static inline int wv_cu_start(struct net_device * dev)
*
* (called by wv_hw_reset())
*/
*
* (called by wv_hw_reset())
*/
-static in
line in
t wv_82586_start(struct net_device * dev)
+static int wv_82586_start(struct net_device * dev)
{
net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr;
{
net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr;
@@
-3647,7
+3643,7
@@
static void wv_82586_config(struct net_device * dev)
* WaveLAN controller (i82586).
* (called by wavelan_close())
*/
* WaveLAN controller (i82586).
* (called by wavelan_close())
*/
-static
inline
void wv_82586_stop(struct net_device * dev)
+static void wv_82586_stop(struct net_device * dev)
{
net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr;
{
net_local *lp = (net_local *) dev->priv;
unsigned long ioaddr = dev->base_addr;
@@
-3772,7
+3768,7
@@
static int wv_check_ioaddr(unsigned long ioaddr, u8 * mac)
* This function is the interrupt handler for the WaveLAN card. This
* routine will be called whenever:
*/
* This function is the interrupt handler for the WaveLAN card. This
* routine will be called whenever:
*/
-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 net_device *dev;
unsigned long ioaddr;
{
struct net_device *dev;
unsigned long ioaddr;
@@
-4194,11
+4190,9
@@
static int __init wavelan_config(struct net_device *dev, unsigned short ioaddr)
dev->set_mac_address = &wavelan_set_mac_address;
#endif /* SET_MAC_ADDRESS */
dev->set_mac_address = &wavelan_set_mac_address;
#endif /* SET_MAC_ADDRESS */
-#ifdef WIRELESS_EXT /* if wireless extension exists in the kernel */
dev->wireless_handlers = &wavelan_handler_def;
lp->wireless_data.spy_data = &lp->spy_data;
dev->wireless_data = &lp->wireless_data;
dev->wireless_handlers = &wavelan_handler_def;
lp->wireless_data.spy_data = &lp->spy_data;
dev->wireless_data = &lp->wireless_data;
-#endif
dev->mtu = WAVELAN_MTU;
dev->mtu = WAVELAN_MTU;
@@
-4314,7
+4308,7
@@
out:
* Insertion of the module
* I'm now quite proud of the multi-device support.
*/
* Insertion of the module
* I'm now quite proud of the multi-device support.
*/
-int init_module(void)
+int
__init
init_module(void)
{
int ret = -EIO; /* Return error if no cards found */
int i;
{
int ret = -EIO; /* Return error if no cards found */
int i;