aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/hamradio/6pack.c4
-rw-r--r--drivers/net/hamradio/baycom_epp.c4
-rw-r--r--drivers/net/hamradio/bpqether.c10
-rw-r--r--drivers/net/hamradio/dmascc.c4
-rw-r--r--drivers/net/hamradio/hdlcdrv.c4
-rw-r--r--drivers/net/hamradio/mkiss.c4
-rw-r--r--drivers/net/hamradio/scc.c5
-rw-r--r--drivers/net/hamradio/yam.c4
-rw-r--r--include/net/ax25.h8
-rw-r--r--net/ax25/ax25_ds_subr.c3
-rw-r--r--net/ax25/ax25_out.c3
11 files changed, 19 insertions, 34 deletions
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index 067b353e1cbd..89454915b857 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -394,13 +394,11 @@ static void sp_bump(struct sixpack *sp, char cmd)
394 if ((skb = dev_alloc_skb(count)) == NULL) 394 if ((skb = dev_alloc_skb(count)) == NULL)
395 goto out_mem; 395 goto out_mem;
396 396
397 skb->dev = sp->dev;
398 ptr = skb_put(skb, count); 397 ptr = skb_put(skb, count);
399 *ptr++ = cmd; /* KISS command */ 398 *ptr++ = cmd; /* KISS command */
400 399
401 memcpy(ptr, sp->cooked_buf + 1, count); 400 memcpy(ptr, sp->cooked_buf + 1, count);
402 skb->mac.raw = skb->data; 401 skb->protocol = ax25_type_trans(skb, sp->dev);
403 skb->protocol = htons(ETH_P_AX25);
404 netif_rx(skb); 402 netif_rx(skb);
405 sp->dev->last_rx = jiffies; 403 sp->dev->last_rx = jiffies;
406 sp->stats.rx_packets++; 404 sp->stats.rx_packets++;
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
index e8cb87d906fc..1c563f905a59 100644
--- a/drivers/net/hamradio/baycom_epp.c
+++ b/drivers/net/hamradio/baycom_epp.c
@@ -601,12 +601,10 @@ static void do_rxpacket(struct net_device *dev)
601 bc->stats.rx_dropped++; 601 bc->stats.rx_dropped++;
602 return; 602 return;
603 } 603 }
604 skb->dev = dev;
605 cp = skb_put(skb, pktlen); 604 cp = skb_put(skb, pktlen);
606 *cp++ = 0; /* KISS kludge */ 605 *cp++ = 0; /* KISS kludge */
607 memcpy(cp, bc->hdlcrx.buf, pktlen - 1); 606 memcpy(cp, bc->hdlcrx.buf, pktlen - 1);
608 skb->protocol = htons(ETH_P_AX25); 607 skb->protocol = ax25_type_trans(skb, dev);
609 skb->mac.raw = skb->data;
610 netif_rx(skb); 608 netif_rx(skb);
611 dev->last_rx = jiffies; 609 dev->last_rx = jiffies;
612 bc->stats.rx_packets++; 610 bc->stats.rx_packets++;
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;
221unlock: 217unlock:
@@ -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++;
diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c
index f3269b70a8c5..f515245a3fd0 100644
--- a/drivers/net/hamradio/dmascc.c
+++ b/drivers/net/hamradio/dmascc.c
@@ -1306,9 +1306,7 @@ static void rx_bh(void *arg)
1306 data = skb_put(skb, cb + 1); 1306 data = skb_put(skb, cb + 1);
1307 data[0] = 0; 1307 data[0] = 0;
1308 memcpy(&data[1], priv->rx_buf[i], cb); 1308 memcpy(&data[1], priv->rx_buf[i], cb);
1309 skb->dev = priv->dev; 1309 skb->protocol = ax25_type_trans(skb, priv->dev);
1310 skb->protocol = ntohs(ETH_P_AX25);
1311 skb->mac.raw = skb->data;
1312 netif_rx(skb); 1310 netif_rx(skb);
1313 priv->dev->last_rx = jiffies; 1311 priv->dev->last_rx = jiffies;
1314 priv->stats.rx_packets++; 1312 priv->stats.rx_packets++;
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c
index b89959a596d7..b4c836e4fe86 100644
--- a/drivers/net/hamradio/hdlcdrv.c
+++ b/drivers/net/hamradio/hdlcdrv.c
@@ -174,12 +174,10 @@ static void hdlc_rx_flag(struct net_device *dev, struct hdlcdrv_state *s)
174 s->stats.rx_dropped++; 174 s->stats.rx_dropped++;
175 return; 175 return;
176 } 176 }
177 skb->dev = dev;
178 cp = skb_put(skb, pkt_len); 177 cp = skb_put(skb, pkt_len);
179 *cp++ = 0; /* KISS kludge */ 178 *cp++ = 0; /* KISS kludge */
180 memcpy(cp, s->hdlcrx.buffer, pkt_len - 1); 179 memcpy(cp, s->hdlcrx.buffer, pkt_len - 1);
181 skb->protocol = htons(ETH_P_AX25); 180 skb->protocol = ax25_type_trans(skb, dev);
182 skb->mac.raw = skb->data;
183 netif_rx(skb); 181 netif_rx(skb);
184 dev->last_rx = jiffies; 182 dev->last_rx = jiffies;
185 s->stats.rx_packets++; 183 s->stats.rx_packets++;
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
index d9ea080aea0f..62790511098f 100644
--- a/drivers/net/hamradio/mkiss.c
+++ b/drivers/net/hamradio/mkiss.c
@@ -332,12 +332,10 @@ static void ax_bump(struct ax_disp *ax)
332 return; 332 return;
333 } 333 }
334 334
335 skb->dev = ax->dev;
336 spin_lock_bh(&ax->buflock); 335 spin_lock_bh(&ax->buflock);
337 memcpy(skb_put(skb,count), ax->rbuff, count); 336 memcpy(skb_put(skb,count), ax->rbuff, count);
338 spin_unlock_bh(&ax->buflock); 337 spin_unlock_bh(&ax->buflock);
339 skb->mac.raw = skb->data; 338 skb->protocol = ax25_type_trans(skb, ax->dev);
340 skb->protocol = htons(ETH_P_AX25);
341 netif_rx(skb); 339 netif_rx(skb);
342 ax->dev->last_rx = jiffies; 340 ax->dev->last_rx = jiffies;
343 ax->rx_packets++; 341 ax->rx_packets++;
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index ce9e7af020da..ece1b1a13186 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -1630,10 +1630,7 @@ static void scc_net_rx(struct scc_channel *scc, struct sk_buff *skb)
1630 scc->dev_stat.rx_packets++; 1630 scc->dev_stat.rx_packets++;
1631 scc->dev_stat.rx_bytes += skb->len; 1631 scc->dev_stat.rx_bytes += skb->len;
1632 1632
1633 skb->dev = scc->dev; 1633 skb->protocol = ax25_type_trans(skb, scc->dev);
1634 skb->protocol = htons(ETH_P_AX25);
1635 skb->mac.raw = skb->data;
1636 skb->pkt_type = PACKET_HOST;
1637 1634
1638 netif_rx(skb); 1635 netif_rx(skb);
1639 scc->dev->last_rx = jiffies; 1636 scc->dev->last_rx = jiffies;
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index fd7b00fe38e5..41213ef602dc 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -522,12 +522,10 @@ static inline void yam_rx_flag(struct net_device *dev, struct yam_port *yp)
522 ++yp->stats.rx_dropped; 522 ++yp->stats.rx_dropped;
523 } else { 523 } else {
524 unsigned char *cp; 524 unsigned char *cp;
525 skb->dev = dev;
526 cp = skb_put(skb, pkt_len); 525 cp = skb_put(skb, pkt_len);
527 *cp++ = 0; /* KISS kludge */ 526 *cp++ = 0; /* KISS kludge */
528 memcpy(cp, yp->rx_buf, pkt_len - 1); 527 memcpy(cp, yp->rx_buf, pkt_len - 1);
529 skb->protocol = htons(ETH_P_AX25); 528 skb->protocol = ax25_type_trans(skb, dev);
530 skb->mac.raw = skb->data;
531 netif_rx(skb); 529 netif_rx(skb);
532 dev->last_rx = jiffies; 530 dev->last_rx = jiffies;
533 ++yp->stats.rx_packets; 531 ++yp->stats.rx_packets;
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 875edbba396d..9e6368a54547 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -220,6 +220,14 @@ static __inline__ void ax25_cb_put(ax25_cb *ax25)
220 } 220 }
221} 221}
222 222
223static inline unsigned short ax25_type_trans(struct sk_buff *skb, struct net_device *dev)
224{
225 skb->dev = dev;
226 skb->pkt_type = PACKET_HOST;
227 skb->mac.raw = skb->data;
228 return htons(ETH_P_AX25);
229}
230
223/* af_ax25.c */ 231/* af_ax25.c */
224extern struct hlist_head ax25_list; 232extern struct hlist_head ax25_list;
225extern spinlock_t ax25_list_lock; 233extern spinlock_t ax25_list_lock;
diff --git a/net/ax25/ax25_ds_subr.c b/net/ax25/ax25_ds_subr.c
index 10ffd2beba3f..1d4ab641f82b 100644
--- a/net/ax25/ax25_ds_subr.c
+++ b/net/ax25/ax25_ds_subr.c
@@ -143,8 +143,7 @@ static void ax25_kiss_cmd(ax25_dev *ax25_dev, unsigned char cmd, unsigned char p
143 *p++ = cmd; 143 *p++ = cmd;
144 *p++ = param; 144 *p++ = param;
145 145
146 skb->dev = ax25_dev->dev; 146 skb->protocol = ax25_type_trans(skb, ax25_dev->dev);
147 skb->protocol = htons(ETH_P_AX25);
148 147
149 dev_queue_xmit(skb); 148 dev_queue_xmit(skb);
150} 149}
diff --git a/net/ax25/ax25_out.c b/net/ax25/ax25_out.c
index 94557b1a1fa2..5fc048dcd39a 100644
--- a/net/ax25/ax25_out.c
+++ b/net/ax25/ax25_out.c
@@ -351,8 +351,7 @@ void ax25_queue_xmit(struct sk_buff *skb, struct net_device *dev)
351{ 351{
352 unsigned char *ptr; 352 unsigned char *ptr;
353 353
354 skb->protocol = htons(ETH_P_AX25); 354 skb->protocol = ax25_type_trans(skb, ax25_fwd_dev(dev));
355 skb->dev = ax25_fwd_dev(dev);
356 355
357 ptr = skb_push(skb, 1); 356 ptr = skb_push(skb, 1);
358 *ptr = 0x00; /* KISS */ 357 *ptr = 0x00; /* KISS */