patch-2.1.18 linux/net/802/llc_macinit.c

Next file: linux/net/802/p8022.c
Previous file: linux/kernel/module.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.17/linux/net/802/llc_macinit.c linux/net/802/llc_macinit.c
@@ -1,9 +1,9 @@
 /*
  * NET		An implementation of the IEEE 802.2 LLC protocol for the
- *		LINUX operating system.  LLC is implemented as a set of 
+ *		LINUX operating system.  LLC is implemented as a set of
  *		state machines and callbacks for higher networking layers.
  *
- *		Code for initialization, termination, registration and 
+ *		Code for initialization, termination, registration and
  *		MAC layer glue.
  *
  *		Written by Tim Alpaerts, Tim_Alpaerts@toyota-motor-europe.com
@@ -16,7 +16,7 @@
  *	Changes
  *		Alan Cox	:	Chainsawed to Linux format
  *					Added llc_ to names
- *					Started restructuring handlers 
+ *					Started restructuring handlers
  */
 
 #include <linux/module.h>
@@ -35,11 +35,11 @@
 /*
  *	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. 
+ *	MAC address in the pdu.
  *	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. 
+ *	the skb.
 */
 
 int llc_mac_data_indicate(llcptr lp, struct sk_buff *skb, struct device *dev, struct packet_type *pt)
@@ -49,12 +49,12 @@
 	unsigned char type;
 	frameptr fr;
 	int free=1;
-	
+
 	/*
-	 *	Truncate buffer to true 802.3 length  
+	 *	Truncate buffer to true 802.3 length
 	 *	[FIXME: move to 802.2 demux]
 	 */
-	  
+
 	ll = *(skb->data -2) * 256 + *(skb->data -1);
 	skb_trim( skb, ll );
 
@@ -64,23 +64,23 @@
 
 	if (type <= FRMR_RSP)
 	{
-		/* 
-		 *	PDU is of the type 2 set 
+		/*
+		 *	PDU is of the type 2 set
 		 */
-		if ((lp->llc_mode == MODE_ABM)||(type == SABME_CMD)) 
+		if ((lp->llc_mode == MODE_ABM)||(type == SABME_CMD))
 			llc_process_otype2_frame(lp, skb, type);
-              
+
 	}
-	else 
+	else
 	{
 		/*
-		 *	PDU belongs to type 1 set 
+		 *	PDU belongs to type 1 set
 		 */
 	        p_flag = fr->u_hdr.u_pflag;
         	switch(type)
         	{
 		        case TEST_CMD:
-				llc_sendpdu(lp, TEST_RSP, 0,ll -3, 
+				llc_sendpdu(lp, TEST_RSP, 0,ll -3,
 					fr->u_hdr.u_info);
 				break;
 			case TEST_RSP:
@@ -88,12 +88,12 @@
 				{
 					lp->ops->test_indication_ep(lp,
 						ll -3, fr->u_hdr.u_info);
-				}   
+				}
 				break;
-			case XID_CMD: 	
+			case XID_CMD:
 				/*
-				 *	Basic format XID is handled by LLC itself 
-				 *	Doc 5.4.1.1.2 p 48/49 
+				 *	Basic format XID is handled by LLC itself
+				 *	Doc 5.4.1.1.2 p 48/49
 				 */
 
 				if ((ll == 6)&&(fr->u_hdr.u_info[0] == 0x81))
@@ -105,10 +105,10 @@
 				}
 				break;
 
-			case XID_RSP:	        
+			case XID_RSP:
 				if( ll == 6 && fr->u_hdr.u_info[0] == 0x81 )
 				{
-					lp->k = fr->u_hdr.u_info[2]; 
+					lp->k = fr->u_hdr.u_info[2];
 				}
 				if (lp->ops->xid_indication_ep != NULL)
 				{
@@ -118,24 +118,24 @@
 				break;
 
 			case UI_CMD:
-				if(lp->ops->unit_data_indication_ep != NULL) 
+				if(lp->ops->unit_data_indication_ep != NULL)
 				{
 					free=lp->ops->unit_data_indication_ep(lp,
 						ll-3, fr->u_hdr.u_info);
 				}
 				break;
-	               
-			default: 
+
+			default:
 				/*
-				 *	All other type 1 pdus ignored for now 
+				 *	All other type 1 pdus ignored for now
 				 */
-		}         
+		}
 	}
-	
+
 	if (free&&(!(IS_IFRAME(fr))))
 	{
 		/*
-		 *	No auto free for I pdus 
+		 *	No auto free for I pdus
 		 */
 		skb->sk = NULL;
 		kfree_skb(skb, FREE_READ);
@@ -148,9 +148,9 @@
  *	Create an LLC client. As it is the job of the caller to clean up
  *	LLC's on device down, the device list must be locked before this call.
  */
- 
+
 int register_cl2llc_client(llcptr lp, const char *device, llc_ops *ops, u8 *rmac, u8 ssap, u8 dsap)
-{       
+{
 	char eye_init[] = "LLC\0";
 
 	memset(lp, 0, sizeof(*lp));
@@ -163,12 +163,12 @@
 	lp->n1 = 1490;
 	lp->n2 = 10;
 	lp->timer_interval[P_TIMER] = HZ;    /* 1 sec */
-	lp->timer_interval[REJ_TIMER] = HZ/8; 
+	lp->timer_interval[REJ_TIMER] = HZ/8;
 	lp->timer_interval[ACK_TIMER] = HZ/8;
 	lp->timer_interval[BUSY_TIMER] = HZ*2;
 	lp->local_sap = ssap;
 	lp->ops = ops;
-	lp->remote_mac_len = lp->dev->addr_len; 
+	lp->remote_mac_len = lp->dev->addr_len;
 	memcpy(lp->remote_mac, rmac, lp->remote_mac_len);
 	lp->state = 0;
 	lp->llc_mode = MODE_ADM;
@@ -188,26 +188,20 @@
 }
 
 
-static struct symbol_table cl2llc_proto_syms = 
-{
-#include <linux/symtab_begin.h>
-	X(register_cl2llc_client),
-	X(unregister_cl2llc_client),
-	X(llc_data_request),
-	X(llc_unit_data_request),
-	X(llc_test_request),
-	X(llc_xid_request),
-#include <linux/symtab_end.h>
-};
+EXPORT_SYMBOL(register_cl2llc_client);
+EXPORT_SYMBOL(unregister_cl2llc_client);
+EXPORT_SYMBOL(llc_data_request);
+EXPORT_SYMBOL(llc_unit_data_request);
+EXPORT_SYMBOL(llc_test_request);
+EXPORT_SYMBOL(llc_xid_request);
 
 
 #define ALL_TYPES_8022 0
 
 void llc_init(struct net_proto *proto)
 {
-	register_symtab( &cl2llc_proto_syms ); 
 	printk(KERN_NOTICE "IEEE 802.2 LLC for Linux 2.1 (c) 1996 Tim Alpaerts\n");
-	return;        
+	return;
 }
 
 #ifdef MODULE

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov