]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/skfp/smt.c
[PPP]: Fix skbuff.c:BUG due incorrect logic in process_input_packet()
[linux-2.6-omap-h63xx.git] / drivers / net / skfp / smt.c
index c3a0d2f10b2b237da4684fa2bc83851d958f808b..fe847800acdcd85ac2a962668d6a0b19eadd7415 100644 (file)
@@ -18,6 +18,7 @@
 #include "h/fddi.h"
 #include "h/smc.h"
 #include "h/smt_p.h"
+#include <linux/bitrev.h>
 
 #define KERNEL
 #include "h/smtstate.h"
@@ -26,8 +27,6 @@
 static const char ID_sccs[] = "@(#)smt.c       2.43 98/11/23 (C) SK " ;
 #endif
 
-extern const u_char canonical[256] ;
-
 /*
  * FC in SMbuf
  */
@@ -110,7 +109,7 @@ static void smt_fill_setcount(struct s_smc *smc, struct smt_p_setcount *setcount
 static void smt_fill_echo(struct s_smc *smc, struct smt_p_echo *echo, u_long seed,
                          int len);
 
-void smt_clear_una_dna(struct s_smc *smc);
+static void smt_clear_una_dna(struct s_smc *smc);
 static void smt_clear_old_una_dna(struct s_smc *smc);
 #ifdef CONCENTRATOR
 static int entity_to_index(void);
@@ -118,7 +117,7 @@ static int entity_to_index(void);
 static void update_dac(struct s_smc *smc, int report);
 static int div_ratio(u_long upper, u_long lower);
 #ifdef  USE_CAN_ADDR
-void   hwm_conv_can(struct s_smc *smc, char *data, int len);
+static void    hwm_conv_can(struct s_smc *smc, char *data, int len);
 #else
 #define                hwm_conv_can(smc,data,len)
 #endif
@@ -180,7 +179,7 @@ void smt_agent_init(struct s_smc *smc)
        driver_get_bia(smc,&smc->mib.fddiSMTStationId.sid_node) ;
        for (i = 0 ; i < 6 ; i ++) {
                smc->mib.fddiSMTStationId.sid_node.a[i] =
-                       canonical[smc->mib.fddiSMTStationId.sid_node.a[i]] ;
+                       bitrev8(smc->mib.fddiSMTStationId.sid_node.a[i]);
        }
        smc->mib.fddiSMTManufacturerData[0] =
                smc->mib.fddiSMTStationId.sid_node.a[0] ;
@@ -216,24 +215,6 @@ void smt_agent_task(struct s_smc *smc)
        DB_SMT("SMT agent task\n",0,0) ;
 }
 
-void smt_please_reconnect(struct s_smc *smc, int reconn_time)
-/* struct s_smc        *smc;  Pointer to SMT context */
-/* int reconn_time;    Wait for reconnect time in seconds */
-{
-       /*
-        * The please reconnect variable is used as a timer.
-        * It is decremented each time smt_event is called.
-        * This happens every second or when smt_force_irq is called.
-        * Note: smt_force_irq () is called on some packet receives and
-        *       when a multicast address is changed. Since nothing
-        *       is received during the disconnect and the multicast
-        *       address changes can be viewed as not very often and
-        *       the timer runs out close to its given value
-        *       (reconn_time).
-        */
-       smc->sm.please_reconnect = reconn_time ;
-}
-
 #ifndef SMT_REAL_TOKEN_CT
 void smt_emulate_token_ct(struct s_smc *smc, int mac_index)
 {
@@ -1574,7 +1555,7 @@ static void smt_fill_echo(struct s_smc *smc, struct smt_p_echo *echo, u_long see
  * clear DNA and UNA
  * called from CFM if configuration changes
  */
-void smt_clear_una_dna(struct s_smc *smc)
+static void smt_clear_una_dna(struct s_smc *smc)
 {
        smc->mib.m[MAC0].fddiMACUpstreamNbr = SMT_Unknown ;
        smc->mib.m[MAC0].fddiMACDownstreamNbr = SMT_Unknown ;
@@ -1914,7 +1895,7 @@ void smt_swap_para(struct smt_header *sm, int len, int direction)
 
 static void smt_string_swap(char *data, const char *format, int len)
 {
-       const char      *open_paren = 0 ;
+       const char      *open_paren = NULL ;
        int     x ;
 
        while (len > 0  && *format) {
@@ -2057,39 +2038,18 @@ int smt_action(struct s_smc *smc, int class, int code, int index)
        return(0) ;
 }
 
-/*
- * change tneg
- *     set T_Req in MIB (Path Attribute)
- *     calculate new values for MAC
- *     if change required
- *             disconnect
- *             set reconnect
- *     end
- */
-void smt_change_t_neg(struct s_smc *smc, u_long tneg)
-{
-       smc->mib.a[PATH0].fddiPATHMaxT_Req = tneg ;
-
-       if (smt_set_mac_opvalues(smc)) {
-               RS_SET(smc,RS_EVENT) ;
-               smc->sm.please_reconnect = 1 ;
-               queue_event(smc,EVENT_ECM,EC_DISCONNECT) ;
-       }
-}
-
 /*
  * canonical conversion of <len> bytes beginning form *data
  */
 #ifdef  USE_CAN_ADDR
-void hwm_conv_can(struct s_smc *smc, char *data, int len)
+static void hwm_conv_can(struct s_smc *smc, char *data, int len)
 {
        int i ;
 
        SK_UNUSED(smc) ;
 
-       for (i = len; i ; i--, data++) {
-               *data = canonical[*(u_char *)data] ;
-       }
+       for (i = len; i ; i--, data++)
+               *data = bitrev8(*data);
 }
 #endif