|
Lines 2362-2370
orinoco_xmit(struct sk_buff *skb, struct
Link Here
|
| 2362 |
return 0; |
2362 |
return 0; |
| 2363 |
} |
2363 |
} |
| 2364 |
|
2364 |
|
| 2365 |
/* Length of the packet body */ |
2365 |
/* Check packet length, pad short packets, round up odd length */ |
| 2366 |
/* FIXME: what if the skb is smaller than this? */ |
2366 |
len = max_t(int, ALIGN(skb->len, 2), ETH_ZLEN); |
| 2367 |
len = max_t(int,skb->len - ETH_HLEN, ETH_ZLEN - ETH_HLEN); |
2367 |
if (skb->len < len) { |
|
|
2368 |
skb = skb_padto(skb, len); |
| 2369 |
if (skb == NULL) |
| 2370 |
goto fail; |
| 2371 |
} |
| 2372 |
len -= ETH_HLEN; |
| 2368 |
|
2373 |
|
| 2369 |
eh = (struct ethhdr *)skb->data; |
2374 |
eh = (struct ethhdr *)skb->data; |
| 2370 |
|
2375 |
|
|
Lines 2414-2421
orinoco_xmit(struct sk_buff *skb, struct
Link Here
|
| 2414 |
p = skb->data; |
2419 |
p = skb->data; |
| 2415 |
} |
2420 |
} |
| 2416 |
|
2421 |
|
| 2417 |
/* Round up for odd length packets */ |
2422 |
err = hermes_bap_pwrite(hw, USER_BAP, p, data_len, txfid, data_off); |
| 2418 |
err = hermes_bap_pwrite(hw, USER_BAP, p, RUP_EVEN(data_len), txfid, data_off); |
|
|
| 2419 |
if (err) { |
2423 |
if (err) { |
| 2420 |
printk(KERN_ERR "%s: Error %d writing packet to BAP\n", |
2424 |
printk(KERN_ERR "%s: Error %d writing packet to BAP\n", |
| 2421 |
dev->name, err); |
2425 |
dev->name, err); |