diff options
author | Arnaldo Carvalho de Melo <acme@ghostprotocols.net> | 2005-04-24 21:53:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-04-24 21:53:06 -0400 |
commit | 56cb515628e6a831bb76783f282a71f7285dad33 (patch) | |
tree | ef7a70e6269eaf6f616066b6e1cd718a394d94bb /drivers/net/hamradio/bpqether.c | |
parent | 3b2d59d1fc86cc7217f165100a939907802dc67c (diff) |
[AX25] Introduce ax25_type_trans
Replacing the open coded equivalents and making ax25 look more like
a linux network protocol, i.e. more similar to inet.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hamradio/bpqether.c')
-rw-r--r-- | drivers/net/hamradio/bpqether.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index ef1a359e2273..ba9f0580e1f9 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c | |||
@@ -211,11 +211,7 @@ static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty | |||
211 | ptr = skb_push(skb, 1); | 211 | ptr = skb_push(skb, 1); |
212 | *ptr = 0; | 212 | *ptr = 0; |
213 | 213 | ||
214 | skb->dev = dev; | 214 | skb->protocol = ax25_type_trans(skb, dev); |
215 | skb->protocol = htons(ETH_P_AX25); | ||
216 | skb->mac.raw = skb->data; | ||
217 | skb->pkt_type = PACKET_HOST; | ||
218 | |||
219 | netif_rx(skb); | 215 | netif_rx(skb); |
220 | dev->last_rx = jiffies; | 216 | dev->last_rx = jiffies; |
221 | unlock: | 217 | unlock: |
@@ -272,8 +268,6 @@ static int bpq_xmit(struct sk_buff *skb, struct net_device *dev) | |||
272 | skb = newskb; | 268 | skb = newskb; |
273 | } | 269 | } |
274 | 270 | ||
275 | skb->protocol = htons(ETH_P_AX25); | ||
276 | |||
277 | ptr = skb_push(skb, 2); | 271 | ptr = skb_push(skb, 2); |
278 | 272 | ||
279 | *ptr++ = (size + 5) % 256; | 273 | *ptr++ = (size + 5) % 256; |
@@ -287,7 +281,7 @@ static int bpq_xmit(struct sk_buff *skb, struct net_device *dev) | |||
287 | return -ENODEV; | 281 | return -ENODEV; |
288 | } | 282 | } |
289 | 283 | ||
290 | skb->dev = dev; | 284 | skb->protocol = ax25_type_trans(skb, dev); |
291 | skb->nh.raw = skb->data; | 285 | skb->nh.raw = skb->data; |
292 | dev->hard_header(skb, dev, ETH_P_BPQ, bpq->dest_addr, NULL, 0); | 286 | dev->hard_header(skb, dev, ETH_P_BPQ, bpq->dest_addr, NULL, 0); |
293 | bpq->stats.tx_packets++; | 287 | bpq->stats.tx_packets++; |