if_smc patch

Jacques Fourie jacques.fourie at gmail.com
Fri Jan 9 01:52:53 PST 2009


Hi,

I'm not sure who the maintainer of the if_smc code is, but here is a 
simple patch that addresses what seems like typos in the original code.

diff -u -r smc.old/if_smc.c smc.new/if_smc.c
--- smc.old/if_smc.c    2009-01-09 10:31:56.000000000 +0200
+++ smc.new/if_smc.c    2009-01-09 11:45:01.000000000 +0200
@@ -494,7 +494,7 @@
         * Work out how many 256 byte "pages" we need.  We have to 
include the
         * control data for the packet in this calculation.
         */
-       npages = (len * PKT_CTRL_DATA_LEN) >> 8;
+       npages = (len + PKT_CTRL_DATA_LEN) >> 8;
        if (npages == 0)
                npages = 1;
 
diff -u -r smc.old/if_smcreg.h smc.new/if_smcreg.h
--- smc.old/if_smcreg.h 2009-01-09 10:31:56.000000000 +0200
+++ smc.new/if_smcreg.h 2009-01-09 11:45:01.000000000 +0200
@@ -138,7 +138,7 @@
 #define        GPR                     0xa
 
 /* Bank 1, Offset 0xc: Control Register */
-#define        CTR                     0xa
+#define        CTR                     0xc
 #define        CTR_STORE               0x0001  /* Store registers to 
EEPROM */
 #define        CTR_RELOAD              0x0002  /* Reload registers from 
EEPROM */
 #define        CTR_EEPROM_SELECT       0x0004  /* Select registers to 
store/reload */




More information about the freebsd-arm mailing list