Commit 7fd71e58 authored by Al Viro's avatar Al Viro Committed by Jeff Garzik

cycx: annotations and fixes (.24 fodder?)

skb->protocol is net-endian, TYVM...
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 71f1bb1a
...@@ -503,7 +503,7 @@ static int cycx_netdevice_init(struct net_device *dev) ...@@ -503,7 +503,7 @@ static int cycx_netdevice_init(struct net_device *dev)
dev->addr_len = 0; /* hardware address length */ dev->addr_len = 0; /* hardware address length */
if (!chan->svc) if (!chan->svc)
*(u16*)dev->dev_addr = htons(chan->lcn); *(__be16*)dev->dev_addr = htons(chan->lcn);
/* Initialize hardware parameters (just for reference) */ /* Initialize hardware parameters (just for reference) */
dev->irq = wandev->irq; dev->irq = wandev->irq;
...@@ -565,7 +565,7 @@ static int cycx_netdevice_hard_header(struct sk_buff *skb, ...@@ -565,7 +565,7 @@ static int cycx_netdevice_hard_header(struct sk_buff *skb,
const void *daddr, const void *saddr, const void *daddr, const void *saddr,
unsigned len) unsigned len)
{ {
skb->protocol = type; skb->protocol = htons(type);
return dev->hard_header_len; return dev->hard_header_len;
} }
...@@ -600,15 +600,15 @@ static int cycx_netdevice_hard_start_xmit(struct sk_buff *skb, ...@@ -600,15 +600,15 @@ static int cycx_netdevice_hard_start_xmit(struct sk_buff *skb,
struct cycx_device *card = chan->card; struct cycx_device *card = chan->card;
if (!chan->svc) if (!chan->svc)
chan->protocol = skb->protocol; chan->protocol = ntohs(skb->protocol);
if (card->wandev.state != WAN_CONNECTED) if (card->wandev.state != WAN_CONNECTED)
++chan->ifstats.tx_dropped; ++chan->ifstats.tx_dropped;
else if (chan->svc && chan->protocol && else if (chan->svc && chan->protocol &&
chan->protocol != skb->protocol) { chan->protocol != ntohs(skb->protocol)) {
printk(KERN_INFO printk(KERN_INFO
"%s: unsupported Ethertype 0x%04X on interface %s!\n", "%s: unsupported Ethertype 0x%04X on interface %s!\n",
card->devname, skb->protocol, dev->name); card->devname, ntohs(skb->protocol), dev->name);
++chan->ifstats.tx_errors; ++chan->ifstats.tx_errors;
} else if (chan->protocol == ETH_P_IP) { } else if (chan->protocol == ETH_P_IP) {
switch (chan->state) { switch (chan->state) {
...@@ -1401,7 +1401,7 @@ static void cycx_x25_set_chan_state(struct net_device *dev, u8 state) ...@@ -1401,7 +1401,7 @@ static void cycx_x25_set_chan_state(struct net_device *dev, u8 state)
switch (state) { switch (state) {
case WAN_CONNECTED: case WAN_CONNECTED:
string_state = "connected!"; string_state = "connected!";
*(u16*)dev->dev_addr = htons(chan->lcn); *(__be16*)dev->dev_addr = htons(chan->lcn);
netif_wake_queue(dev); netif_wake_queue(dev);
reset_timer(dev); reset_timer(dev);
......
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