diff options
Diffstat (limited to 'net/802')
-rw-r--r-- | net/802/Makefile | 2 | ||||
-rw-r--r-- | net/802/cl2llc.c | 2 | ||||
-rw-r--r-- | net/802/cl2llc.pre | 2 | ||||
-rw-r--r-- | net/802/fddi.c | 33 | ||||
-rw-r--r-- | net/802/llc_macinit.c | 13 | ||||
-rw-r--r-- | net/802/llc_sendpdu.c | 3 |
6 files changed, 31 insertions, 24 deletions
diff --git a/net/802/Makefile b/net/802/Makefile index a8d25f77e..cea2410d8 100644 --- a/net/802/Makefile +++ b/net/802/Makefile @@ -17,7 +17,7 @@ endif ifeq ($(CONFIG_LLC),y) SUB_DIRS += transit O_OBJS += llc_sendpdu.o llc_utility.o cl2llc.o -OX_OBJS += llc_macinit.o +OX_OBJS += llc_macinit.o p8022.o psnap.o p8022tr.o endif ifdef CONFIG_TR diff --git a/net/802/cl2llc.c b/net/802/cl2llc.c index 5e1d12837..8d236b4c4 100644 --- a/net/802/cl2llc.c +++ b/net/802/cl2llc.c @@ -196,7 +196,7 @@ void llc_interpret_pseudo_code(llcptr lp, int pc_label, struct sk_buff *skb, switch(pseudo_code[pc]) { case 9: - if ((type != I_CMD) || (fr->i_hdr.i_pflag =0)) + if ((type != I_CMD) || (fr->i_hdr.i_pflag == 0)) break; case 1: lp->remote_busy = 0; diff --git a/net/802/cl2llc.pre b/net/802/cl2llc.pre index 8e10cf32a..023c2b45c 100644 --- a/net/802/cl2llc.pre +++ b/net/802/cl2llc.pre @@ -196,7 +196,7 @@ void llc_interpret_pseudo_code(llcptr lp, int pc_label, struct sk_buff *skb, switch(pseudo_code[pc]) { case IF_F=1_CLEAR_REMOTE_BUSY: - if ((type != I_CMD) || (fr->i_hdr.i_pflag =0)) + if ((type != I_CMD) || (fr->i_hdr.i_pflag == 0)) break; case CLEAR_REMOTE_BUSY: lp->remote_busy = 0; diff --git a/net/802/fddi.c b/net/802/fddi.c index c57a967d1..a282cc386 100644 --- a/net/802/fddi.c +++ b/net/802/fddi.c @@ -56,11 +56,11 @@ int fddi_header(struct sk_buff *skb, struct device *dev, unsigned short type, int hl = FDDI_K_SNAP_HLEN; struct fddihdr *fddi; - if(type!=htons(ETH_P_IP)) + if(type != ETH_P_IP && type != ETH_P_ARP) hl=FDDI_K_8022_HLEN-3; fddi = (struct fddihdr *)skb_push(skb, hl); fddi->fc = FDDI_FC_K_ASYNC_LLC_DEF; - if(type==htons(ETH_P_IP)) + if(type == ETH_P_IP || type == ETH_P_ARP) { fddi->hdr.llc_snap.dsap = FDDI_EXTENDED_SAP; fddi->hdr.llc_snap.ssap = FDDI_EXTENDED_SAP; @@ -68,7 +68,7 @@ int fddi_header(struct sk_buff *skb, struct device *dev, unsigned short type, fddi->hdr.llc_snap.oui[0] = 0x00; fddi->hdr.llc_snap.oui[1] = 0x00; fddi->hdr.llc_snap.oui[2] = 0x00; - fddi->hdr.llc_snap.ethertype = htons(type); + fddi->hdr.llc_snap.ethertype = htons(type); } /* Set the source and destination hardware addresses */ @@ -83,6 +83,7 @@ int fddi_header(struct sk_buff *skb, struct device *dev, unsigned short type, memcpy(fddi->daddr, daddr, dev->addr_len); return(hl); } + return(-hl); } @@ -96,18 +97,29 @@ int fddi_header(struct sk_buff *skb, struct device *dev, unsigned short type, int fddi_rebuild_header(struct sk_buff *skb) { struct fddihdr *fddi = (struct fddihdr *)skb->data; +#if 0 + struct neighbour *neigh = NULL; - /* Only ARP/IP is currently supported */ - - if (fddi->hdr.llc_snap.ethertype != htons(ETH_P_IP)) + if (skb->dst) + neigh = skb->dst->neighbour; + + if (neigh) + return neigh->ops->resolve(fddi->daddr, skb); +#endif + /* + * Only ARP/IP is currently supported + */ + + if (fddi->hdr.llc_snap.ethertype != __constant_htons(ETH_P_IP)) { - printk("fddi_rebuild_header: Don't know how to resolve type %04X addresses?\n", (unsigned int)htons(fddi->hdr.llc_snap.ethertype)); + printk("%s: Don't know how to resolve type %02X addresses.\n", + skb->dev->name, htons(fddi->hdr.llc_snap.ethertype)); return(0); } /* Try to get ARP to resolve the header and fill destination address */ - return arp_find(fddi->daddr, skb) ? 1 : 0; + return arp_find(fddi->daddr, skb); } /* @@ -127,12 +139,12 @@ unsigned short fddi_type_trans(struct sk_buff *skb, struct device *dev) * to start of packet data. Assume 802.2 SNAP frames for now. */ - skb->mac.raw = skb->data; /* point to frame control (FC) */ + skb->mac.raw = skb->data; /* point to frame control (FC) */ if(fddi->hdr.llc_8022_1.dsap==0xe0) { skb_pull(skb, FDDI_K_8022_HLEN-3); - type=htons(ETH_P_802_2); + type = __constant_htons(ETH_P_802_2); } else { @@ -159,5 +171,4 @@ unsigned short fddi_type_trans(struct sk_buff *skb, struct device *dev) /* Assume 802.2 SNAP frames, for now */ return(type); - } diff --git a/net/802/llc_macinit.c b/net/802/llc_macinit.c index c72be3d4d..198230c36 100644 --- a/net/802/llc_macinit.c +++ b/net/802/llc_macinit.c @@ -36,15 +36,14 @@ /* * All incoming frames pass thru mac_data_indicate(). - * Here an llc structure is associated with an skb depending on the source - * MAC address in the pdu. + * On entry the llc structure related to the frame is passed as parameter. * The received sk_buffs with pdus other than I_CMD and I_RSP * are freed by mac_data_indicate() after processing, * the I pdu buffers are freed by the cl2llc client when it no longer needs * the skb. */ -int llc_mac_data_indicate(llcptr lp, struct sk_buff *skb, struct device *dev, struct packet_type *pt) +int llc_mac_data_indicate(llcptr lp, struct sk_buff *skb) { int ll; /* logical length == 802.3 length field */ unsigned char p_flag; @@ -142,7 +141,7 @@ int llc_mac_data_indicate(llcptr lp, struct sk_buff *skb, struct device *dev, st if(lp->llc_callbacks) { - lp->llc_event(lp); + if ( lp->llc_event != NULL ) lp->llc_event(lp); lp->llc_callbacks=0; } return 0; @@ -173,8 +172,7 @@ int register_cl2llc_client(llcptr lp, const char *device, void (*event)(llcptr), lp->timer_interval[BUSY_TIMER] = HZ*2; lp->local_sap = ssap; lp->llc_event = event; - lp->remote_mac_len = lp->dev->addr_len; - memcpy(lp->remote_mac, rmac, lp->remote_mac_len); + memcpy(lp->remote_mac, rmac, sizeof(lp->remote_mac)); lp->state = 0; lp->llc_mode = MODE_ADM; lp->remote_sap = dsap; @@ -199,7 +197,8 @@ EXPORT_SYMBOL(llc_data_request); EXPORT_SYMBOL(llc_unit_data_request); EXPORT_SYMBOL(llc_test_request); EXPORT_SYMBOL(llc_xid_request); - +EXPORT_SYMBOL(llc_mac_data_indicate); +EXPORT_SYMBOL(llc_cancel_timers); #define ALL_TYPES_8022 0 diff --git a/net/802/llc_sendpdu.c b/net/802/llc_sendpdu.c index 436ddb9c7..5aeaecfbe 100644 --- a/net/802/llc_sendpdu.c +++ b/net/802/llc_sendpdu.c @@ -162,7 +162,6 @@ void llc_sendpdu(llcptr lp, char type, char pf, int data_len, char *pdu_data) lp->dev->hard_header(skb, lp->dev, ETH_P_802_3, lp->remote_mac, NULL, fl); skb->arp = 1; - skb->priority=SOPRI_NORMAL; skb->dev=lp->dev; dev_queue_xmit(skb); } @@ -220,7 +219,6 @@ void llc_sendipdu(llcptr lp, char type, char pf, struct sk_buff *skb) if(tmp!=NULL) { tmp->dev=lp->dev; - tmp->priority=SOPRI_NORMAL; dev_queue_xmit(tmp); } } @@ -288,7 +286,6 @@ int llc_resend_ipdu(llcptr lp, unsigned char ack_nr, unsigned char type, char p) { tmp->arp = 1; tmp->dev = lp->dev; - tmp->priority = SOPRI_NORMAL; dev_queue_xmit(skb); } resend_count++; |