/* Look in the table if the frequency is allowed */
if (table[9 - (freq / 16)] & (1 << (freq % 16))) {
/* Compute approximate channel number */
- while ((c < NELS(channel_bands)) &&
- (((channel_bands[c] >> 1) - 24) < freq))
+ while ((((channel_bands[c] >> 1) - 24) < freq) &&
+ (c < NELS(channel_bands)))
c++;
list[i].i = c; /* Set the list index */
{
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,
* able to detect collisions, therefore in theory we don't really
* need to pad. Jean II */
if (skb->len < ETH_ZLEN) {
- 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 */
+ skb = skb_padto(skb, ETH_ZLEN);
+ if (skb == NULL)
+ return 0;
}
- else if(wv_packet_write(dev, skb->data, skb->len))
- return 1; /* We failed */
+ /* Write packet on the card */
+ if(wv_packet_write(dev, skb->data, skb->len))
+ return 1; /* We failed */
dev_kfree_skb(skb);
* Insertion of the module
* I'm now quite proud of the multi-device support.
*/
-int __init init_module(void)
+int init_module(void)
{
int ret = -EIO; /* Return error if no cards found */
int i;