cosmetic changes to bcm570x driver
authorVadim Bendebury <vbendeb@google.com>
Thu, 24 May 2007 22:52:25 +0000 (15:52 -0700)
committerBen Warren <bwarren@qstreams.com>
Thu, 7 Jun 2007 19:21:23 +0000 (15:21 -0400)
This is a cosmetic only changes submission.
It affects files relevant to bcm570x driver.
the commands used to generate this change was

cd drivers
Lindent -pcs -l80  bcm570x.c   bcm570x_lm.h   bcm570x_mm.h  tigon3.c  tigon3.h

The BMW target (the only one using this chip so far) builds cleanly, the
`before and after' generated object files for drivers/bcm570x.c and
drivers/tigon3.o are identical as reported by objdump -d

Signed-off-by: Vadim Bendebury <vbendeb@google.com>
Signed-off-by: Ben Warren <bwarren@qstreams.com>
drivers/bcm570x.c
drivers/bcm570x_lm.h
drivers/bcm570x_mm.h
drivers/tigon3.c
drivers/tigon3.h

index 5f632a6..7aeb547 100644 (file)
@@ -18,7 +18,6 @@
 #include <pci.h>
 #include <malloc.h>
 
-
 /*
  * PCI Registers and definitions.
  */
@@ -31,7 +30,6 @@
 #define BCM570X_MBAR   0x80100000
 #define BCM570X_ILINE   1
 
-
 #define SECOND_USEC    1000000
 #define MAX_PACKET_SIZE 1600
 #define MAX_UNITS       4
 /* Globals to this module */
 int initialized = 0;
 unsigned int ioBase = 0;
-volatile PLM_DEVICE_BLOCK    pDevice = NULL;        /* 570x softc */
-volatile PUM_DEVICE_BLOCK    pUmDevice = NULL;
+volatile PLM_DEVICE_BLOCK pDevice = NULL;      /* 570x softc */
+volatile PUM_DEVICE_BLOCK pUmDevice = NULL;
 
 /* Used to pass the full-duplex flag, etc. */
-int line_speed[MAX_UNITS] = {0,0,0,0};
-static int full_duplex[MAX_UNITS] = {1,1,1,1};
-static int rx_flow_control[MAX_UNITS] = {0,0,0,0};
-static int tx_flow_control[MAX_UNITS] = {0,0,0,0};
-static int auto_flow_control[MAX_UNITS] = {0,0,0,0};
-static int tx_checksum[MAX_UNITS] = {1,1,1,1};
-static int rx_checksum[MAX_UNITS] = {1,1,1,1};
-static int auto_speed[MAX_UNITS] = {1,1,1,1};
+int line_speed[MAX_UNITS] = { 0, 0, 0, 0 };
+static int full_duplex[MAX_UNITS] = { 1, 1, 1, 1 };
+static int rx_flow_control[MAX_UNITS] = { 0, 0, 0, 0 };
+static int tx_flow_control[MAX_UNITS] = { 0, 0, 0, 0 };
+static int auto_flow_control[MAX_UNITS] = { 0, 0, 0, 0 };
+static int tx_checksum[MAX_UNITS] = { 1, 1, 1, 1 };
+static int rx_checksum[MAX_UNITS] = { 1, 1, 1, 1 };
+static int auto_speed[MAX_UNITS] = { 1, 1, 1, 1 };
 
 #if JUMBO_FRAMES
 /* Jumbo MTU for interfaces. */
-static int mtu[MAX_UNITS] = {0,0,0,0};
+static int mtu[MAX_UNITS] = { 0, 0, 0, 0 };
 #endif
 
 /* Turn on Wake-on lan for a device unit */
-static int enable_wol[MAX_UNITS] = {0,0,0,0};
+static int enable_wol[MAX_UNITS] = { 0, 0, 0, 0 };
 
 #define TX_DESC_CNT DEFAULT_TX_PACKET_DESC_COUNT
 static unsigned int tx_pkt_desc_cnt[MAX_UNITS] =
-       {TX_DESC_CNT,TX_DESC_CNT,TX_DESC_CNT, TX_DESC_CNT};
+    { TX_DESC_CNT, TX_DESC_CNT, TX_DESC_CNT, TX_DESC_CNT };
 
 #define RX_DESC_CNT DEFAULT_STD_RCV_DESC_COUNT
 static unsigned int rx_std_desc_cnt[MAX_UNITS] =
-       {RX_DESC_CNT,RX_DESC_CNT,RX_DESC_CNT,RX_DESC_CNT};
+    { RX_DESC_CNT, RX_DESC_CNT, RX_DESC_CNT, RX_DESC_CNT };
 
-static unsigned int rx_adaptive_coalesce[MAX_UNITS] = {1,1,1,1};
+static unsigned int rx_adaptive_coalesce[MAX_UNITS] = { 1, 1, 1, 1 };
 
 #if T3_JUMBO_RCV_RCB_ENTRY_COUNT
 #define JBO_DESC_CNT DEFAULT_JUMBO_RCV_DESC_COUNT
 static unsigned int rx_jumbo_desc_cnt[MAX_UNITS] =
-       {JBO_DESC_CNT, JBO_DESC_CNT, JBO_DESC_CNT, JBO_DESC_CNT};
+    { JBO_DESC_CNT, JBO_DESC_CNT, JBO_DESC_CNT, JBO_DESC_CNT };
 #endif
 #define RX_COAL_TK DEFAULT_RX_COALESCING_TICKS
 static unsigned int rx_coalesce_ticks[MAX_UNITS] =
-       {RX_COAL_TK, RX_COAL_TK, RX_COAL_TK, RX_COAL_TK};
+    { RX_COAL_TK, RX_COAL_TK, RX_COAL_TK, RX_COAL_TK };
 
 #define RX_COAL_FM DEFAULT_RX_MAX_COALESCED_FRAMES
 static unsigned int rx_max_coalesce_frames[MAX_UNITS] =
-       {RX_COAL_FM, RX_COAL_FM, RX_COAL_FM, RX_COAL_FM};
+    { RX_COAL_FM, RX_COAL_FM, RX_COAL_FM, RX_COAL_FM };
 
 #define TX_COAL_TK DEFAULT_TX_COALESCING_TICKS
 static unsigned int tx_coalesce_ticks[MAX_UNITS] =
-       {TX_COAL_TK, TX_COAL_TK, TX_COAL_TK, TX_COAL_TK};
+    { TX_COAL_TK, TX_COAL_TK, TX_COAL_TK, TX_COAL_TK };
 
 #define TX_COAL_FM DEFAULT_TX_MAX_COALESCED_FRAMES
 static unsigned int tx_max_coalesce_frames[MAX_UNITS] =
-       {TX_COAL_FM, TX_COAL_FM, TX_COAL_FM, TX_COAL_FM};
+    { TX_COAL_FM, TX_COAL_FM, TX_COAL_FM, TX_COAL_FM };
 
 #define ST_COAL_TK DEFAULT_STATS_COALESCING_TICKS
 static unsigned int stats_coalesce_ticks[MAX_UNITS] =
-       {ST_COAL_TK, ST_COAL_TK, ST_COAL_TK, ST_COAL_TK};
-
+    { ST_COAL_TK, ST_COAL_TK, ST_COAL_TK, ST_COAL_TK };
 
 /*
  * Legitimate values for BCM570x device types
@@ -134,707 +131,701 @@ typedef enum {
 
 /* Chip-Rev names for each device-type */
 static struct {
-    char* name;
+       char *name;
 } chip_rev[] = {
-       {"BCM5700VIGIL"},
-       {"BCM5700A6"},
-       {"BCM5700T6"},
-       {"BCM5700A9"},
-       {"BCM5700T9"},
-       {"BCM5700"},
-       {"BCM5701A5"},
-       {"BCM5701T1"},
-       {"BCM5701T8"},
-       {"BCM5701A7"},
-       {"BCM5701A10"},
-       {"BCM5701A12"},
-       {"BCM5701"},
-       {"BCM5702"},
-       {"BCM5703"},
-       {"BCM5703A31"},
-       {"TC996T"},
-       {"TC996ST"},
-       {"TC996SSX"},
-       {"TC996SX"},
-       {"TC996BT"},
-       {"TC997T"},
-       {"TC997SX"},
-       {"TC1000T"},
-       {"TC940BR01"},
-       {"TC942BR01"},
-       {"NC6770"},
-       {"NC7760"},
-       {"NC7770"},
-       {"NC7780"},
-       {0}
+       {
+       "BCM5700VIGIL"}, {
+       "BCM5700A6"}, {
+       "BCM5700T6"}, {
+       "BCM5700A9"}, {
+       "BCM5700T9"}, {
+       "BCM5700"}, {
+       "BCM5701A5"}, {
+       "BCM5701T1"}, {
+       "BCM5701T8"}, {
+       "BCM5701A7"}, {
+       "BCM5701A10"}, {
+       "BCM5701A12"}, {
+       "BCM5701"}, {
+       "BCM5702"}, {
+       "BCM5703"}, {
+       "BCM5703A31"}, {
+       "TC996T"}, {
+       "TC996ST"}, {
+       "TC996SSX"}, {
+       "TC996SX"}, {
+       "TC996BT"}, {
+       "TC997T"}, {
+       "TC997SX"}, {
+       "TC1000T"}, {
+       "TC940BR01"}, {
+       "TC942BR01"}, {
+       "NC6770"}, {
+       "NC7760"}, {
+       "NC7770"}, {
+       "NC7780"}, {
+       0}
 };
 
-
 /* indexed by board_t, above */
 static struct {
-    char *name;
+       char *name;
 } board_info[] = {
-       { "Broadcom Vigil B5700 1000Base-T" },
-       { "Broadcom BCM5700 1000Base-T" },
-       { "Broadcom BCM5700 1000Base-SX" },
-       { "Broadcom BCM5700 1000Base-SX" },
-       { "Broadcom BCM5700 1000Base-T" },
-       { "Broadcom BCM5700" },
-       { "Broadcom BCM5701 1000Base-T" },
-       { "Broadcom BCM5701 1000Base-T" },
-       { "Broadcom BCM5701 1000Base-T" },
-       { "Broadcom BCM5701 1000Base-SX" },
-       { "Broadcom BCM5701 1000Base-T" },
-       { "Broadcom BCM5701 1000Base-T" },
-       { "Broadcom BCM5701" },
-       { "Broadcom BCM5702 1000Base-T" },
-       { "Broadcom BCM5703 1000Base-T" },
-       { "Broadcom BCM5703 1000Base-SX" },
-       { "3Com 3C996 10/100/1000 Server NIC" },
-       { "3Com 3C996 10/100/1000 Server NIC" },
-       { "3Com 3C996 Gigabit Fiber-SX Server NIC" },
-       { "3Com 3C996 Gigabit Fiber-SX Server NIC" },
-       { "3Com 3C996B Gigabit Server NIC" },
-       { "3Com 3C997 Gigabit Server NIC" },
-       { "3Com 3C997 Gigabit Fiber-SX Server NIC" },
-       { "3Com 3C1000 Gigabit NIC" },
-       { "3Com 3C940 Gigabit LOM (21X21)" },
-       { "3Com 3C942 Gigabit LOM (31X31)" },
-       { "Compaq NC6770 Gigabit Server Adapter" },
-       { "Compaq NC7760 Gigabit Server Adapter" },
-       { "Compaq NC7770 Gigabit Server Adapter" },
-       { "Compaq NC7780 Gigabit Server Adapter" },
-       { 0 },
-};
+       {
+       "Broadcom Vigil B5700 1000Base-T"}, {
+       "Broadcom BCM5700 1000Base-T"}, {
+       "Broadcom BCM5700 1000Base-SX"}, {
+       "Broadcom BCM5700 1000Base-SX"}, {
+       "Broadcom BCM5700 1000Base-T"}, {
+       "Broadcom BCM5700"}, {
+       "Broadcom BCM5701 1000Base-T"}, {
+       "Broadcom BCM5701 1000Base-T"}, {
+       "Broadcom BCM5701 1000Base-T"}, {
+       "Broadcom BCM5701 1000Base-SX"}, {
+       "Broadcom BCM5701 1000Base-T"}, {
+       "Broadcom BCM5701 1000Base-T"}, {
+       "Broadcom BCM5701"}, {
+       "Broadcom BCM5702 1000Base-T"}, {
+       "Broadcom BCM5703 1000Base-T"}, {
+       "Broadcom BCM5703 1000Base-SX"}, {
+       "3Com 3C996 10/100/1000 Server NIC"}, {
+       "3Com 3C996 10/100/1000 Server NIC"}, {
+       "3Com 3C996 Gigabit Fiber-SX Server NIC"}, {
+       "3Com 3C996 Gigabit Fiber-SX Server NIC"}, {
+       "3Com 3C996B Gigabit Server NIC"}, {
+       "3Com 3C997 Gigabit Server NIC"}, {
+       "3Com 3C997 Gigabit Fiber-SX Server NIC"}, {
+       "3Com 3C1000 Gigabit NIC"}, {
+       "3Com 3C940 Gigabit LOM (21X21)"}, {
+       "3Com 3C942 Gigabit LOM (31X31)"}, {
+       "Compaq NC6770 Gigabit Server Adapter"}, {
+       "Compaq NC7760 Gigabit Server Adapter"}, {
+       "Compaq NC7770 Gigabit Server Adapter"}, {
+       "Compaq NC7780 Gigabit Server Adapter"}, {
+0},};
 
 /* PCI Devices which use the 570x chipset */
 struct pci_device_table {
-    unsigned short vendor_id, device_id; /* Vendor/DeviceID */
-    unsigned short subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */
-    unsigned int class, class_mask; /* (class,subclass,prog-if) triplet */
-    unsigned long board_id;        /* Data private to the driver */
-    int io_size, min_latency;
+       unsigned short vendor_id, device_id;    /* Vendor/DeviceID */
+       unsigned short subvendor, subdevice;    /* Subsystem ID's or PCI_ANY_ID */
+       unsigned int class, class_mask; /* (class,subclass,prog-if) triplet */
+       unsigned long board_id; /* Data private to the driver */
+       int io_size, min_latency;
 } bcm570xDevices[] = {
-       {0x14e4, 0x1644, 0x1014, 0x0277, 0, 0, BCM5700VIGIL ,128,32},
-       {0x14e4, 0x1644, 0x14e4, 0x1644, 0, 0, BCM5700A6 ,128,32},
-       {0x14e4, 0x1644, 0x14e4, 0x2, 0, 0, BCM5700T6 ,128,32},
-       {0x14e4, 0x1644, 0x14e4, 0x3, 0, 0, BCM5700A9 ,128,32},
-       {0x14e4, 0x1644, 0x14e4, 0x4, 0, 0, BCM5700T9 ,128,32},
-       {0x14e4, 0x1644, 0x1028, 0xd1, 0, 0, BCM5700 ,128,32},
-       {0x14e4, 0x1644, 0x1028, 0x0106, 0, 0, BCM5700 ,128,32},
-       {0x14e4, 0x1644, 0x1028, 0x0109, 0, 0, BCM5700 ,128,32},
-       {0x14e4, 0x1644, 0x1028, 0x010a, 0, 0, BCM5700 ,128,32},
-       {0x14e4, 0x1644, 0x10b7, 0x1000, 0, 0, TC996T ,128,32},
-       {0x14e4, 0x1644, 0x10b7, 0x1001, 0, 0, TC996ST ,128,32},
-       {0x14e4, 0x1644, 0x10b7, 0x1002, 0, 0, TC996SSX ,128,32},
-       {0x14e4, 0x1644, 0x10b7, 0x1003, 0, 0, TC997T ,128,32},
-       {0x14e4, 0x1644, 0x10b7, 0x1005, 0, 0, TC997SX ,128,32},
-       {0x14e4, 0x1644, 0x10b7, 0x1008, 0, 0, TC942BR01 ,128,32},
-       {0x14e4, 0x1644, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5700 ,128,32},
-       {0x14e4, 0x1645, 0x14e4, 1, 0, 0, BCM5701A5 ,128,32},
-       {0x14e4, 0x1645, 0x14e4, 5, 0, 0, BCM5701T1 ,128,32},
-       {0x14e4, 0x1645, 0x14e4, 6, 0, 0, BCM5701T8 ,128,32},
-       {0x14e4, 0x1645, 0x14e4, 7, 0, 0, BCM5701A7 ,128,32},
-       {0x14e4, 0x1645, 0x14e4, 8, 0, 0, BCM5701A10 ,128,32},
-       {0x14e4, 0x1645, 0x14e4, 0x8008, 0, 0, BCM5701A12 ,128,32},
-       {0x14e4, 0x1645, 0x0e11, 0xc1, 0, 0, NC6770 ,128,32},
-       {0x14e4, 0x1645, 0x0e11, 0x7c, 0, 0, NC7770 ,128,32},
-       {0x14e4, 0x1645, 0x0e11, 0x85, 0, 0, NC7780 ,128,32},
-       {0x14e4, 0x1645, 0x1028, 0x0121, 0, 0, BCM5701 ,128,32},
-       {0x14e4, 0x1645, 0x10b7, 0x1004, 0, 0, TC996SX ,128,32},
-       {0x14e4, 0x1645, 0x10b7, 0x1006, 0, 0, TC996BT ,128,32},
-       {0x14e4, 0x1645, 0x10b7, 0x1007, 0, 0, TC1000T ,128,32},
-       {0x14e4, 0x1645, 0x10b7, 0x1008, 0, 0, TC940BR01 ,128,32},
-       {0x14e4, 0x1645, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5701 ,128,32},
-       {0x14e4, 0x1646, 0x14e4, 0x8009, 0, 0, BCM5702 ,128,32},
-       {0x14e4, 0x1646, 0x0e11, 0xbb, 0, 0, NC7760 ,128,32},
-       {0x14e4, 0x1646, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5702 ,128,32},
-       {0x14e4, 0x16a6, 0x14e4, 0x8009, 0, 0, BCM5702 ,128,32},
-       {0x14e4, 0x16a6, 0x0e11, 0xbb, 0, 0, NC7760 ,128,32},
-       {0x14e4, 0x16a6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5702 ,128,32},
-       {0x14e4, 0x1647, 0x14e4, 0x0009, 0, 0, BCM5703 ,128,32},
-       {0x14e4, 0x1647, 0x14e4, 0x000a, 0, 0, BCM5703A31 ,128,32},
-       {0x14e4, 0x1647, 0x14e4, 0x000b, 0, 0, BCM5703 ,128,32},
-       {0x14e4, 0x1647, 0x14e4, 0x800a, 0, 0, BCM5703 ,128,32},
-       {0x14e4, 0x1647, 0x0e11, 0x9a, 0, 0, NC7770 ,128,32},
-       {0x14e4, 0x1647, 0x0e11, 0x99, 0, 0, NC7780 ,128,32},
-       {0x14e4, 0x1647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5703 ,128,32},
-       {0x14e4, 0x16a7, 0x14e4, 0x0009, 0, 0, BCM5703 ,128,32},
-       {0x14e4, 0x16a7, 0x14e4, 0x000a, 0, 0, BCM5703A31 ,128,32},
-       {0x14e4, 0x16a7, 0x14e4, 0x000b, 0, 0, BCM5703 ,128,32},
-       {0x14e4, 0x16a7, 0x14e4, 0x800a, 0, 0, BCM5703 ,128,32},
-       {0x14e4, 0x16a7, 0x0e11, 0x9a, 0, 0, NC7770 ,128,32},
-       {0x14e4, 0x16a7, 0x0e11, 0x99, 0, 0, NC7780 ,128,32},
-       {0x14e4, 0x16a7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5703 ,128,32}
+       {
+       0x14e4, 0x1644, 0x1014, 0x0277, 0, 0, BCM5700VIGIL, 128, 32}, {
+       0x14e4, 0x1644, 0x14e4, 0x1644, 0, 0, BCM5700A6, 128, 32}, {
+       0x14e4, 0x1644, 0x14e4, 0x2, 0, 0, BCM5700T6, 128, 32}, {
+       0x14e4, 0x1644, 0x14e4, 0x3, 0, 0, BCM5700A9, 128, 32}, {
+       0x14e4, 0x1644, 0x14e4, 0x4, 0, 0, BCM5700T9, 128, 32}, {
+       0x14e4, 0x1644, 0x1028, 0xd1, 0, 0, BCM5700, 128, 32}, {
+       0x14e4, 0x1644, 0x1028, 0x0106, 0, 0, BCM5700, 128, 32}, {
+       0x14e4, 0x1644, 0x1028, 0x0109, 0, 0, BCM5700, 128, 32}, {
+       0x14e4, 0x1644, 0x1028, 0x010a, 0, 0, BCM5700, 128, 32}, {
+       0x14e4, 0x1644, 0x10b7, 0x1000, 0, 0, TC996T, 128, 32}, {
+       0x14e4, 0x1644, 0x10b7, 0x1001, 0, 0, TC996ST, 128, 32}, {
+       0x14e4, 0x1644, 0x10b7, 0x1002, 0, 0, TC996SSX, 128, 32}, {
+       0x14e4, 0x1644, 0x10b7, 0x1003, 0, 0, TC997T, 128, 32}, {
+       0x14e4, 0x1644, 0x10b7, 0x1005, 0, 0, TC997SX, 128, 32}, {
+       0x14e4, 0x1644, 0x10b7, 0x1008, 0, 0, TC942BR01, 128, 32}, {
+       0x14e4, 0x1644, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5700, 128, 32}, {
+       0x14e4, 0x1645, 0x14e4, 1, 0, 0, BCM5701A5, 128, 32}, {
+       0x14e4, 0x1645, 0x14e4, 5, 0, 0, BCM5701T1, 128, 32}, {
+       0x14e4, 0x1645, 0x14e4, 6, 0, 0, BCM5701T8, 128, 32}, {
+       0x14e4, 0x1645, 0x14e4, 7, 0, 0, BCM5701A7, 128, 32}, {
+       0x14e4, 0x1645, 0x14e4, 8, 0, 0, BCM5701A10, 128, 32}, {
+       0x14e4, 0x1645, 0x14e4, 0x8008, 0, 0, BCM5701A12, 128, 32}, {
+       0x14e4, 0x1645, 0x0e11, 0xc1, 0, 0, NC6770, 128, 32}, {
+       0x14e4, 0x1645, 0x0e11, 0x7c, 0, 0, NC7770, 128, 32}, {
+       0x14e4, 0x1645, 0x0e11, 0x85, 0, 0, NC7780, 128, 32}, {
+       0x14e4, 0x1645, 0x1028, 0x0121, 0, 0, BCM5701, 128, 32}, {
+       0x14e4, 0x1645, 0x10b7, 0x1004, 0, 0, TC996SX, 128, 32}, {
+       0x14e4, 0x1645, 0x10b7, 0x1006, 0, 0, TC996BT, 128, 32}, {
+       0x14e4, 0x1645, 0x10b7, 0x1007, 0, 0, TC1000T, 128, 32}, {
+       0x14e4, 0x1645, 0x10b7, 0x1008, 0, 0, TC940BR01, 128, 32}, {
+       0x14e4, 0x1645, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5701, 128, 32}, {
+       0x14e4, 0x1646, 0x14e4, 0x8009, 0, 0, BCM5702, 128, 32}, {
+       0x14e4, 0x1646, 0x0e11, 0xbb, 0, 0, NC7760, 128, 32}, {
+       0x14e4, 0x1646, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5702, 128, 32}, {
+       0x14e4, 0x16a6, 0x14e4, 0x8009, 0, 0, BCM5702, 128, 32}, {
+       0x14e4, 0x16a6, 0x0e11, 0xbb, 0, 0, NC7760, 128, 32}, {
+       0x14e4, 0x16a6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5702, 128, 32}, {
+       0x14e4, 0x1647, 0x14e4, 0x0009, 0, 0, BCM5703, 128, 32}, {
+       0x14e4, 0x1647, 0x14e4, 0x000a, 0, 0, BCM5703A31, 128, 32}, {
+       0x14e4, 0x1647, 0x14e4, 0x000b, 0, 0, BCM5703, 128, 32}, {
+       0x14e4, 0x1647, 0x14e4, 0x800a, 0, 0, BCM5703, 128, 32}, {
+       0x14e4, 0x1647, 0x0e11, 0x9a, 0, 0, NC7770, 128, 32}, {
+       0x14e4, 0x1647, 0x0e11, 0x99, 0, 0, NC7780, 128, 32}, {
+       0x14e4, 0x1647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5703, 128, 32}, {
+       0x14e4, 0x16a7, 0x14e4, 0x0009, 0, 0, BCM5703, 128, 32}, {
+       0x14e4, 0x16a7, 0x14e4, 0x000a, 0, 0, BCM5703A31, 128, 32}, {
+       0x14e4, 0x16a7, 0x14e4, 0x000b, 0, 0, BCM5703, 128, 32}, {
+       0x14e4, 0x16a7, 0x14e4, 0x800a, 0, 0, BCM5703, 128, 32}, {
+       0x14e4, 0x16a7, 0x0e11, 0x9a, 0, 0, NC7770, 128, 32}, {
+       0x14e4, 0x16a7, 0x0e11, 0x99, 0, 0, NC7780, 128, 32}, {
+       0x14e4, 0x16a7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5703, 128, 32}
 };
 
 #define n570xDevices   (sizeof(bcm570xDevices)/sizeof(bcm570xDevices[0]))
 
-
 /*
  * Allocate a packet buffer from the bcm570x packet pool.
  */
-void *
-bcm570xPktAlloc(int u, int pksize)
+void *bcm570xPktAlloc (int u, int pksize)
 {
-    return malloc(pksize);
+       return malloc (pksize);
 }
 
 /*
  * Free a packet previously allocated from the bcm570x packet
  * buffer pool.
  */
-void
-bcm570xPktFree(int u, void *p)
+void bcm570xPktFree (int u, void *p)
 {
-    free(p);
+       free (p);
 }
 
-int
-bcm570xReplenishRxBuffers(PUM_DEVICE_BLOCK pUmDevice)
+int bcm570xReplenishRxBuffers (PUM_DEVICE_BLOCK pUmDevice)
 {
-    PLM_PACKET pPacket;
-    PUM_PACKET pUmPacket;
-    void *skb;
-    int queue_rx = 0;
-    int ret = 0;
-
-    while ((pUmPacket = (PUM_PACKET)
-           QQ_PopHead(&pUmDevice->rx_out_of_buf_q.Container)) != 0) {
-
-       pPacket = (PLM_PACKET) pUmPacket;
-
-       /* reuse an old skb */
-       if (pUmPacket->skbuff) {
-           QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket);
-           queue_rx = 1;
-           continue;
-       }
-       if ( ( skb = bcm570xPktAlloc(pUmDevice->index,
-                                    pPacket->u.Rx.RxBufferSize + 2)) == 0) {
-           QQ_PushHead(&pUmDevice->rx_out_of_buf_q.Container,pPacket);
-           printf("NOTICE: Out of RX memory.\n");
-           ret = 1;
-           break;
-       }
+       PLM_PACKET pPacket;
+       PUM_PACKET pUmPacket;
+       void *skb;
+       int queue_rx = 0;
+       int ret = 0;
+
+       while ((pUmPacket = (PUM_PACKET)
+               QQ_PopHead (&pUmDevice->rx_out_of_buf_q.Container)) != 0) {
+
+               pPacket = (PLM_PACKET) pUmPacket;
+
+               /* reuse an old skb */
+               if (pUmPacket->skbuff) {
+                       QQ_PushTail (&pDevice->RxPacketFreeQ.Container,
+                                    pPacket);
+                       queue_rx = 1;
+                       continue;
+               }
+               if ((skb = bcm570xPktAlloc (pUmDevice->index,
+                                           pPacket->u.Rx.RxBufferSize + 2)) ==
+                   0) {
+                       QQ_PushHead (&pUmDevice->rx_out_of_buf_q.Container,
+                                    pPacket);
+                       printf ("NOTICE: Out of RX memory.\n");
+                       ret = 1;
+                       break;
+               }
 
-       pUmPacket->skbuff = skb;
-       QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket);
-       queue_rx = 1;
-    }
+               pUmPacket->skbuff = skb;
+               QQ_PushTail (&pDevice->RxPacketFreeQ.Container, pPacket);
+               queue_rx = 1;
+       }
 
-    if (queue_rx) {
-       LM_QueueRxPackets(pDevice);
-    }
+       if (queue_rx) {
+               LM_QueueRxPackets (pDevice);
+       }
 
-    return ret;
+       return ret;
 }
 
 /*
  * Probe, Map, and Init 570x device.
  */
-int eth_init(bd_t *bis)
+int eth_init (bd_t * bis)
 {
-    int i, rv, devFound = FALSE;
-    pci_dev_t  devbusfn;
-    unsigned short status;
-
-    /* Find PCI device, if it exists, configure ...  */
-    for( i = 0; i < n570xDevices; i++){
-       devbusfn = pci_find_device(bcm570xDevices[i].vendor_id,
-                                  bcm570xDevices[i].device_id, 0);
-       if(devbusfn == -1) {
-           continue; /* No device of that vendor/device ID */
+       int i, rv, devFound = FALSE;
+       pci_dev_t devbusfn;
+       unsigned short status;
+
+       /* Find PCI device, if it exists, configure ...  */
+       for (i = 0; i < n570xDevices; i++) {
+               devbusfn = pci_find_device (bcm570xDevices[i].vendor_id,
+                                           bcm570xDevices[i].device_id, 0);
+               if (devbusfn == -1) {
+                       continue;       /* No device of that vendor/device ID */
+               } else {
+
+                       /* Set ILINE */
+                       pci_write_config_byte (devbusfn,
+                                              PCI_INTERRUPT_LINE,
+                                              BCM570X_ILINE);
+
+                       /*
+                        * 0x10 - 0x14 define one 64-bit MBAR.
+                        * 0x14 is the higher-order address bits of the BAR.
+                        */
+                       pci_write_config_dword (devbusfn,
+                                               PCI_BASE_ADDRESS_1, 0);
+
+                       ioBase = BCM570X_MBAR;
+
+                       pci_write_config_dword (devbusfn,
+                                               PCI_BASE_ADDRESS_0, ioBase);
+
+                       /*
+                        * Enable PCI memory, IO, and Master -- don't
+                        * reset any status bits in doing so.
+                        */
+                       pci_read_config_word (devbusfn, PCI_COMMAND, &status);
+
+                       status |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER;
+
+                       pci_write_config_word (devbusfn, PCI_COMMAND, status);
+
+                       printf
+                           ("\n%s: bus %d, device %d, function %d: MBAR=0x%x\n",
+                            board_info[bcm570xDevices[i].board_id].name,
+                            PCI_BUS (devbusfn), PCI_DEV (devbusfn),
+                            PCI_FUNC (devbusfn), ioBase);
+
+                       /* Allocate once, but always clear on init */
+                       if (!pDevice) {
+                               pDevice = malloc (sizeof (UM_DEVICE_BLOCK));
+                               pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
+                               memset (pDevice, 0x0, sizeof (UM_DEVICE_BLOCK));
+                       }
+
+                       /* Configure pci dev structure */
+                       pUmDevice->pdev = devbusfn;
+                       pUmDevice->index = 0;
+                       pUmDevice->tx_pkt = 0;
+                       pUmDevice->rx_pkt = 0;
+                       devFound = TRUE;
+                       break;
+               }
+       }
+
+       if (!devFound) {
+               printf
+                   ("eth_init: FAILURE: no BCM570x Ethernet devices found.\n");
+               return -1;
+       }
+
+       /* Setup defaults for chip */
+       pDevice->TaskToOffload = LM_TASK_OFFLOAD_NONE;
+
+       if (pDevice->ChipRevId == T3_CHIP_ID_5700_B0) {
+               pDevice->TaskToOffload = LM_TASK_OFFLOAD_NONE;
        } else {
 
-           /* Set ILINE */
-           pci_write_config_byte(devbusfn,
-                                 PCI_INTERRUPT_LINE, BCM570X_ILINE);
-
-           /*
-            * 0x10 - 0x14 define one 64-bit MBAR.
-            * 0x14 is the higher-order address bits of the BAR.
-            */
-           pci_write_config_dword(devbusfn,
-                                  PCI_BASE_ADDRESS_1, 0);
-
-           ioBase = BCM570X_MBAR;
-
-           pci_write_config_dword(devbusfn,
-                                  PCI_BASE_ADDRESS_0, ioBase);
-
-           /*
-            * Enable PCI memory, IO, and Master -- don't
-            * reset any status bits in doing so.
-            */
-           pci_read_config_word(devbusfn,
-                                PCI_COMMAND, &status);
-
-           status |= PCI_COMMAND_MEMORY|PCI_COMMAND_MASTER;
-
-           pci_write_config_word(devbusfn,
-                                 PCI_COMMAND, status);
-
-           printf("\n%s: bus %d, device %d, function %d: MBAR=0x%x\n",
-                  board_info[bcm570xDevices[i].board_id].name,
-                  PCI_BUS(devbusfn),
-                  PCI_DEV(devbusfn),
-                  PCI_FUNC(devbusfn),
-                  ioBase);
-
-           /* Allocate once, but always clear on init */
-           if (!pDevice) {
-               pDevice = malloc(sizeof(UM_DEVICE_BLOCK));
-               pUmDevice = (PUM_DEVICE_BLOCK)pDevice;
-               memset(pDevice, 0x0, sizeof(UM_DEVICE_BLOCK));
-           }
-
-           /* Configure pci dev structure */
-           pUmDevice->pdev = devbusfn;
-           pUmDevice->index = 0;
-           pUmDevice->tx_pkt = 0;
-           pUmDevice->rx_pkt = 0;
-           devFound = TRUE;
-           break;
+               if (rx_checksum[i]) {
+                       pDevice->TaskToOffload |=
+                           LM_TASK_OFFLOAD_RX_TCP_CHECKSUM |
+                           LM_TASK_OFFLOAD_RX_UDP_CHECKSUM;
+               }
+
+               if (tx_checksum[i]) {
+                       pDevice->TaskToOffload |=
+                           LM_TASK_OFFLOAD_TX_TCP_CHECKSUM |
+                           LM_TASK_OFFLOAD_TX_UDP_CHECKSUM;
+                       pDevice->NoTxPseudoHdrChksum = TRUE;
+               }
+       }
+
+       /* Set Device PCI Memory base address */
+       pDevice->pMappedMemBase = (PLM_UINT8) ioBase;
+
+       /* Pull down adapter info */
+       if ((rv = LM_GetAdapterInfo (pDevice)) != LM_STATUS_SUCCESS) {
+               printf ("bcm570xEnd: LM_GetAdapterInfo failed: rv=%d!\n", rv);
+               return -2;
        }
-    }
 
-    if(!devFound){
-       printf("eth_init: FAILURE: no BCM570x Ethernet devices found.\n");
-       return -1;
-    }
+       /* Lock not needed */
+       pUmDevice->do_global_lock = 0;
 
-    /* Setup defaults for chip */
-    pDevice->TaskToOffload = LM_TASK_OFFLOAD_NONE;
+       if (T3_ASIC_REV (pUmDevice->lm_dev.ChipRevId) == T3_ASIC_REV_5700) {
+               /* The 5700 chip works best without interleaved register */
+               /* accesses on certain machines. */
+               pUmDevice->do_global_lock = 1;
+       }
 
-    if (pDevice->ChipRevId == T3_CHIP_ID_5700_B0) {
-       pDevice->TaskToOffload = LM_TASK_OFFLOAD_NONE;
-    } else {
+       /* Setup timer delays */
+       if (T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5701) {
+               pDevice->UseTaggedStatus = TRUE;
+               pUmDevice->timer_interval = CFG_HZ;
+       } else {
+               pUmDevice->timer_interval = CFG_HZ / 50;
+       }
 
-       if (rx_checksum[i]) {
-           pDevice->TaskToOffload |=
-               LM_TASK_OFFLOAD_RX_TCP_CHECKSUM |
-               LM_TASK_OFFLOAD_RX_UDP_CHECKSUM;
+       /* Grab name .... */
+       pUmDevice->name =
+           (char *)malloc (strlen (board_info[bcm570xDevices[i].board_id].name)
+                           + 1);
+       strcpy (pUmDevice->name, board_info[bcm570xDevices[i].board_id].name);
+
+       memcpy (pDevice->NodeAddress, bis->bi_enetaddr, 6);
+       LM_SetMacAddress (pDevice, bis->bi_enetaddr);
+       /* Init queues  .. */
+       QQ_InitQueue (&pUmDevice->rx_out_of_buf_q.Container,
+                     MAX_RX_PACKET_DESC_COUNT);
+       pUmDevice->rx_last_cnt = pUmDevice->tx_last_cnt = 0;
+
+       /* delay for 4 seconds */
+       pUmDevice->delayed_link_ind = (4 * CFG_HZ) / pUmDevice->timer_interval;
+
+       pUmDevice->adaptive_expiry = CFG_HZ / pUmDevice->timer_interval;
+
+       /* Sometimes we get spurious ints. after reset when link is down. */
+       /* This field tells the isr to service the int. even if there is */
+       /* no status block update. */
+       pUmDevice->adapter_just_inited =
+           (3 * CFG_HZ) / pUmDevice->timer_interval;
+
+       /* Initialize 570x */
+       if (LM_InitializeAdapter (pDevice) != LM_STATUS_SUCCESS) {
+               printf ("ERROR: Adapter initialization failed.\n");
+               return ERROR;
        }
 
-       if (tx_checksum[i]) {
-           pDevice->TaskToOffload |=
-               LM_TASK_OFFLOAD_TX_TCP_CHECKSUM |
-               LM_TASK_OFFLOAD_TX_UDP_CHECKSUM;
-           pDevice->NoTxPseudoHdrChksum = TRUE;
+       /* Enable chip ISR */
+       LM_EnableInterrupt (pDevice);
+
+       /* Clear MC table */
+       LM_MulticastClear (pDevice);
+
+       /* Enable Multicast */
+       LM_SetReceiveMask (pDevice,
+                          pDevice->ReceiveMask | LM_ACCEPT_ALL_MULTICAST);
+
+       pUmDevice->opened = 1;
+       pUmDevice->tx_full = 0;
+       pUmDevice->tx_pkt = 0;
+       pUmDevice->rx_pkt = 0;
+       printf ("eth%d: %s @0x%lx,",
+               pDevice->index, pUmDevice->name, (unsigned long)ioBase);
+       printf ("node addr ");
+       for (i = 0; i < 6; i++) {
+               printf ("%2.2x", pDevice->NodeAddress[i]);
        }
-    }
-
-    /* Set Device PCI Memory base address */
-    pDevice->pMappedMemBase = (PLM_UINT8) ioBase;
-
-    /* Pull down adapter info */
-    if ((rv = LM_GetAdapterInfo(pDevice)) != LM_STATUS_SUCCESS) {
-       printf("bcm570xEnd: LM_GetAdapterInfo failed: rv=%d!\n", rv );
-       return -2;
-    }
-
-    /* Lock not needed */
-    pUmDevice->do_global_lock = 0;
-
-    if (T3_ASIC_REV(pUmDevice->lm_dev.ChipRevId) == T3_ASIC_REV_5700) {
-       /* The 5700 chip works best without interleaved register */
-       /* accesses on certain machines. */
-       pUmDevice->do_global_lock = 1;
-    }
-
-    /* Setup timer delays */
-    if (T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701) {
-       pDevice->UseTaggedStatus = TRUE;
-       pUmDevice->timer_interval = CFG_HZ;
-    }
-    else {
-       pUmDevice->timer_interval = CFG_HZ / 50;
-    }
-
-    /* Grab name .... */
-    pUmDevice->name =
-       (char*)malloc(strlen(board_info[bcm570xDevices[i].board_id].name)+1);
-    strcpy(pUmDevice->name,board_info[bcm570xDevices[i].board_id].name);
-
-    memcpy(pDevice->NodeAddress, bis->bi_enetaddr, 6);
-    LM_SetMacAddress(pDevice, bis->bi_enetaddr);
-    /* Init queues  .. */
-    QQ_InitQueue(&pUmDevice->rx_out_of_buf_q.Container,
-                MAX_RX_PACKET_DESC_COUNT);
-    pUmDevice->rx_last_cnt = pUmDevice->tx_last_cnt = 0;
-
-    /* delay for 4 seconds */
-    pUmDevice->delayed_link_ind =
-       (4 * CFG_HZ) / pUmDevice->timer_interval;
-
-    pUmDevice->adaptive_expiry =
-       CFG_HZ / pUmDevice->timer_interval;
-
-    /* Sometimes we get spurious ints. after reset when link is down. */
-    /* This field tells the isr to service the int. even if there is */
-    /* no status block update. */
-    pUmDevice->adapter_just_inited =
-       (3 * CFG_HZ) / pUmDevice->timer_interval;
-
-    /* Initialize 570x */
-    if (LM_InitializeAdapter(pDevice) != LM_STATUS_SUCCESS) {
-       printf("ERROR: Adapter initialization failed.\n");
-       return ERROR;
-    }
-
-    /* Enable chip ISR */
-    LM_EnableInterrupt(pDevice);
-
-    /* Clear MC table */
-    LM_MulticastClear(pDevice);
-
-    /* Enable Multicast */
-    LM_SetReceiveMask(pDevice,
-                     pDevice->ReceiveMask | LM_ACCEPT_ALL_MULTICAST);
-
-    pUmDevice->opened = 1;
-    pUmDevice->tx_full = 0;
-    pUmDevice->tx_pkt = 0;
-    pUmDevice->rx_pkt = 0;
-    printf("eth%d: %s @0x%lx,",
-          pDevice->index, pUmDevice->name, (unsigned long)ioBase);
-    printf(    "node addr ");
-    for (i = 0; i < 6; i++) {
-       printf("%2.2x", pDevice->NodeAddress[i]);
-    }
-    printf("\n");
-
-    printf("eth%d: ", pDevice->index);
-    printf("%s with ",
-          chip_rev[bcm570xDevices[i].board_id].name);
-
-    if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5400_PHY_ID)
-       printf("Broadcom BCM5400 Copper ");
-    else if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5401_PHY_ID)
-       printf("Broadcom BCM5401 Copper ");
-    else if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5411_PHY_ID)
-       printf("Broadcom BCM5411 Copper ");
-    else if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5701_PHY_ID)
-       printf("Broadcom BCM5701 Integrated Copper ");
-    else if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5703_PHY_ID)
-       printf("Broadcom BCM5703 Integrated Copper ");
-    else if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM8002_PHY_ID)
-       printf("Broadcom BCM8002 SerDes ");
-    else if (pDevice->EnableTbi)
-       printf("Agilent HDMP-1636 SerDes ");
-    else
-       printf("Unknown ");
-    printf("transceiver found\n");
-
-    printf("eth%d: %s, MTU: %d,",
-          pDevice->index, pDevice->BusSpeedStr, 1500);
-
-    if ((pDevice->ChipRevId != T3_CHIP_ID_5700_B0) &&
-       rx_checksum[i])
-       printf("Rx Checksum ON\n");
-    else
-       printf("Rx Checksum OFF\n");
-    initialized++;
-
-    return 0;
+       printf ("\n");
+
+       printf ("eth%d: ", pDevice->index);
+       printf ("%s with ", chip_rev[bcm570xDevices[i].board_id].name);
+
+       if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5400_PHY_ID)
+               printf ("Broadcom BCM5400 Copper ");
+       else if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5401_PHY_ID)
+               printf ("Broadcom BCM5401 Copper ");
+       else if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5411_PHY_ID)
+               printf ("Broadcom BCM5411 Copper ");
+       else if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5701_PHY_ID)
+               printf ("Broadcom BCM5701 Integrated Copper ");
+       else if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5703_PHY_ID)
+               printf ("Broadcom BCM5703 Integrated Copper ");
+       else if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM8002_PHY_ID)
+               printf ("Broadcom BCM8002 SerDes ");
+       else if (pDevice->EnableTbi)
+               printf ("Agilent HDMP-1636 SerDes ");
+       else
+               printf ("Unknown ");
+       printf ("transceiver found\n");
+
+       printf ("eth%d: %s, MTU: %d,",
+               pDevice->index, pDevice->BusSpeedStr, 1500);
+
+       if ((pDevice->ChipRevId != T3_CHIP_ID_5700_B0) && rx_checksum[i])
+               printf ("Rx Checksum ON\n");
+       else
+               printf ("Rx Checksum OFF\n");
+       initialized++;
+
+       return 0;
 }
 
 /* Ethernet Interrupt service routine */
-void
-eth_isr(void)
+void eth_isr (void)
 {
-    LM_UINT32 oldtag, newtag;
-    int i;
-
-    pUmDevice->interrupt = 1;
-
-    if (pDevice->UseTaggedStatus) {
-       if ((pDevice->pStatusBlkVirt->Status & STATUS_BLOCK_UPDATED) ||
-           pUmDevice->adapter_just_inited) {
-           MB_REG_WR(pDevice, Mailbox.Interrupt[0].Low, 1);
-           oldtag = pDevice->pStatusBlkVirt->StatusTag;
-
-           for (i = 0; ; i++) {
-               pDevice->pStatusBlkVirt->Status &= ~STATUS_BLOCK_UPDATED;
-               LM_ServiceInterrupts(pDevice);
-               newtag = pDevice->pStatusBlkVirt->StatusTag;
-               if ((newtag == oldtag) || (i > 50)) {
-                   MB_REG_WR(pDevice, Mailbox.Interrupt[0].Low, newtag << 24);
-                   if (pDevice->UndiFix) {
-                       REG_WR(pDevice, Grc.LocalCtrl,
-                              pDevice->GrcLocalCtrl | 0x2);
-                   }
-                   break;
-                }
-               oldtag = newtag;
-           }
+       LM_UINT32 oldtag, newtag;
+       int i;
+
+       pUmDevice->interrupt = 1;
+
+       if (pDevice->UseTaggedStatus) {
+               if ((pDevice->pStatusBlkVirt->Status & STATUS_BLOCK_UPDATED) ||
+                   pUmDevice->adapter_just_inited) {
+                       MB_REG_WR (pDevice, Mailbox.Interrupt[0].Low, 1);
+                       oldtag = pDevice->pStatusBlkVirt->StatusTag;
+
+                       for (i = 0;; i++) {
+                               pDevice->pStatusBlkVirt->Status &=
+                                   ~STATUS_BLOCK_UPDATED;
+                               LM_ServiceInterrupts (pDevice);
+                               newtag = pDevice->pStatusBlkVirt->StatusTag;
+                               if ((newtag == oldtag) || (i > 50)) {
+                                       MB_REG_WR (pDevice,
+                                                  Mailbox.Interrupt[0].Low,
+                                                  newtag << 24);
+                                       if (pDevice->UndiFix) {
+                                               REG_WR (pDevice, Grc.LocalCtrl,
+                                                       pDevice->
+                                                       GrcLocalCtrl | 0x2);
+                                       }
+                                       break;
+                               }
+                               oldtag = newtag;
+                       }
+               }
+       } else {
+               while (pDevice->pStatusBlkVirt->Status & STATUS_BLOCK_UPDATED) {
+                       unsigned int dummy;
+
+                       pDevice->pMemView->Mailbox.Interrupt[0].Low = 1;
+                       pDevice->pStatusBlkVirt->Status &=
+                           ~STATUS_BLOCK_UPDATED;
+                       LM_ServiceInterrupts (pDevice);
+                       pDevice->pMemView->Mailbox.Interrupt[0].Low = 0;
+                       dummy = pDevice->pMemView->Mailbox.Interrupt[0].Low;
+               }
+       }
+
+       /* Allocate new RX buffers */
+       if (QQ_GetEntryCnt (&pUmDevice->rx_out_of_buf_q.Container)) {
+               bcm570xReplenishRxBuffers (pUmDevice);
        }
-    }
-    else {
-       while (pDevice->pStatusBlkVirt->Status & STATUS_BLOCK_UPDATED) {
-           unsigned int dummy;
-
-           pDevice->pMemView->Mailbox.Interrupt[0].Low = 1;
-           pDevice->pStatusBlkVirt->Status &= ~STATUS_BLOCK_UPDATED;
-           LM_ServiceInterrupts(pDevice);
-           pDevice->pMemView->Mailbox.Interrupt[0].Low = 0;
-           dummy = pDevice->pMemView->Mailbox.Interrupt[0].Low;
+
+       /* Queue packets */
+       if (QQ_GetEntryCnt (&pDevice->RxPacketFreeQ.Container)) {
+               LM_QueueRxPackets (pDevice);
+       }
+
+       if (pUmDevice->tx_queued) {
+               pUmDevice->tx_queued = 0;
        }
-    }
-
-    /* Allocate new RX buffers */
-    if (QQ_GetEntryCnt(&pUmDevice->rx_out_of_buf_q.Container)) {
-       bcm570xReplenishRxBuffers(pUmDevice);
-    }
-
-    /* Queue packets */
-    if (QQ_GetEntryCnt(&pDevice->RxPacketFreeQ.Container)) {
-       LM_QueueRxPackets(pDevice);
-    }
-
-    if (pUmDevice->tx_queued) {
-       pUmDevice->tx_queued = 0;
-    }
-
-    if(pUmDevice->tx_full){
-       if(pDevice->LinkStatus != LM_STATUS_LINK_DOWN){
-           printf("NOTICE: tx was previously blocked, restarting MUX\n");
-           pUmDevice->tx_full = 0;
+
+       if (pUmDevice->tx_full) {
+               if (pDevice->LinkStatus != LM_STATUS_LINK_DOWN) {
+                       printf
+                           ("NOTICE: tx was previously blocked, restarting MUX\n");
+                       pUmDevice->tx_full = 0;
+               }
        }
-    }
 
-    pUmDevice->interrupt = 0;
+       pUmDevice->interrupt = 0;
 
 }
 
-int
-eth_send(volatile void *packet, int length)
+int eth_send (volatile void *packet, int length)
 {
-    int status = 0;
+       int status = 0;
 #if ET_DEBUG
-    unsigned char* ptr = (unsigned char*)packet;
+       unsigned char *ptr = (unsigned char *)packet;
 #endif
-    PLM_PACKET pPacket;
-    PUM_PACKET pUmPacket;
+       PLM_PACKET pPacket;
+       PUM_PACKET pUmPacket;
 
-    /* Link down, return */
-    while(pDevice->LinkStatus == LM_STATUS_LINK_DOWN) {
+       /* Link down, return */
+       while (pDevice->LinkStatus == LM_STATUS_LINK_DOWN) {
 #if 0
-       printf("eth%d: link down - check cable or link partner.\n",
-              pUmDevice->index);
+               printf ("eth%d: link down - check cable or link partner.\n",
+                       pUmDevice->index);
 #endif
-       eth_isr();
+               eth_isr ();
+
+               /* Wait to see link for one-half a second before sending ... */
+               udelay (1500000);
 
-       /* Wait to see link for one-half a second before sending ... */
-       udelay(1500000);
+       }
 
-    }
+       /* Clear sent flag */
+       pUmDevice->tx_pkt = 0;
 
-    /* Clear sent flag */
-    pUmDevice->tx_pkt = 0;
+       /* Previously blocked */
+       if (pUmDevice->tx_full) {
+               printf ("eth%d: tx blocked.\n", pUmDevice->index);
+               return 0;
+       }
 
-    /* Previously blocked */
-    if(pUmDevice->tx_full){
-       printf("eth%d: tx blocked.\n", pUmDevice->index);
-       return 0;
-    }
+       pPacket = (PLM_PACKET)
+           QQ_PopHead (&pDevice->TxPacketFreeQ.Container);
 
-    pPacket = (PLM_PACKET)
-       QQ_PopHead(&pDevice->TxPacketFreeQ.Container);
+       if (pPacket == 0) {
+               pUmDevice->tx_full = 1;
+               printf ("bcm570xEndSend: TX full!\n");
+               return 0;
+       }
 
-    if (pPacket == 0) {
-       pUmDevice->tx_full = 1;
-       printf("bcm570xEndSend: TX full!\n");
-       return 0;
-    }
+       if (pDevice->SendBdLeft.counter == 0) {
+               pUmDevice->tx_full = 1;
+               printf ("bcm570xEndSend: no more TX descriptors!\n");
+               QQ_PushHead (&pDevice->TxPacketFreeQ.Container, pPacket);
+               return 0;
+       }
 
-    if (pDevice->SendBdLeft.counter == 0) {
-       pUmDevice->tx_full = 1;
-       printf("bcm570xEndSend: no more TX descriptors!\n");
-       QQ_PushHead(&pDevice->TxPacketFreeQ.Container, pPacket);
-       return 0;
-    }
-
-    if (length <= 0){
-       printf("eth: bad packet size: %d\n", length);
-       goto out;
-    }
-
-    /* Get packet buffers and fragment list */
-    pUmPacket = (PUM_PACKET) pPacket;
-    /* Single DMA Descriptor transmit.
-     * Fragments may be provided, but one DMA descriptor max is
-     * used to send the packet.
-     */
-    if (MM_CoalesceTxBuffer (pDevice, pPacket) != LM_STATUS_SUCCESS) {
-       if (pUmPacket->skbuff == NULL){
-           /* Packet was discarded */
-           printf("TX: failed (1)\n");
-           status = 1;
-       } else{
-           printf("TX: failed (2)\n");
-           status = 2;
+       if (length <= 0) {
+               printf ("eth: bad packet size: %d\n", length);
+               goto out;
        }
-       QQ_PushHead (&pDevice->TxPacketFreeQ.Container, pPacket);
-       return status;
-    }
-
-    /* Copy packet to DMA buffer */
-    memset(pUmPacket->skbuff, 0x0, MAX_PACKET_SIZE);
-    memcpy((void*)pUmPacket->skbuff, (void*)packet, length);
-    pPacket->PacketSize = length;
-    pPacket->Flags |= SND_BD_FLAG_END|SND_BD_FLAG_COAL_NOW;
-    pPacket->u.Tx.FragCount = 1;
-    /* We've already provided a frame ready for transmission */
-    pPacket->Flags &= ~SND_BD_FLAG_TCP_UDP_CKSUM;
-
-    if ( LM_SendPacket(pDevice, pPacket) == LM_STATUS_FAILURE){
-       /*
-        *  A lower level send failure will push the packet descriptor back
-        *  in the free queue, so just deal with the VxWorks clusters.
+
+       /* Get packet buffers and fragment list */
+       pUmPacket = (PUM_PACKET) pPacket;
+       /* Single DMA Descriptor transmit.
+        * Fragments may be provided, but one DMA descriptor max is
+        * used to send the packet.
         */
-       if (pUmPacket->skbuff == NULL){
-           printf("TX failed (1)!\n");
-           /* Packet was discarded */
-           status = 3;
-       } else {
-           /* A resource problem ... */
-           printf("TX failed (2)!\n");
-           status = 4;
+       if (MM_CoalesceTxBuffer (pDevice, pPacket) != LM_STATUS_SUCCESS) {
+               if (pUmPacket->skbuff == NULL) {
+                       /* Packet was discarded */
+                       printf ("TX: failed (1)\n");
+                       status = 1;
+               } else {
+                       printf ("TX: failed (2)\n");
+                       status = 2;
+               }
+               QQ_PushHead (&pDevice->TxPacketFreeQ.Container, pPacket);
+               return status;
        }
 
-       if (QQ_GetEntryCnt(&pDevice->TxPacketFreeQ.Container) == 0) {
-           printf("TX: emptyQ!\n");
-           pUmDevice->tx_full = 1;
+       /* Copy packet to DMA buffer */
+       memset (pUmPacket->skbuff, 0x0, MAX_PACKET_SIZE);
+       memcpy ((void *)pUmPacket->skbuff, (void *)packet, length);
+       pPacket->PacketSize = length;
+       pPacket->Flags |= SND_BD_FLAG_END | SND_BD_FLAG_COAL_NOW;
+       pPacket->u.Tx.FragCount = 1;
+       /* We've already provided a frame ready for transmission */
+       pPacket->Flags &= ~SND_BD_FLAG_TCP_UDP_CKSUM;
+
+       if (LM_SendPacket (pDevice, pPacket) == LM_STATUS_FAILURE) {
+               /*
+                *  A lower level send failure will push the packet descriptor back
+                *  in the free queue, so just deal with the VxWorks clusters.
+                */
+               if (pUmPacket->skbuff == NULL) {
+                       printf ("TX failed (1)!\n");
+                       /* Packet was discarded */
+                       status = 3;
+               } else {
+                       /* A resource problem ... */
+                       printf ("TX failed (2)!\n");
+                       status = 4;
+               }
+
+               if (QQ_GetEntryCnt (&pDevice->TxPacketFreeQ.Container) == 0) {
+                       printf ("TX: emptyQ!\n");
+                       pUmDevice->tx_full = 1;
+               }
        }
-    }
 
-    while(pUmDevice->tx_pkt == 0){
-       /* Service TX */
-       eth_isr();
-    }
+       while (pUmDevice->tx_pkt == 0) {
+               /* Service TX */
+               eth_isr ();
+       }
 #if ET_DEBUG
-    printf("eth_send: 0x%x, %d bytes\n"
-          "[%x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x] ...\n",
-          (int)pPacket, length,
-          ptr[0],ptr[1],ptr[2],ptr[3],ptr[4],ptr[5],
-          ptr[6],ptr[7],ptr[8],ptr[9],ptr[10],ptr[11],ptr[12],
-          ptr[13],ptr[14],ptr[15]);
+       printf ("eth_send: 0x%x, %d bytes\n"
+               "[%x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x] ...\n",
+               (int)pPacket, length,
+               ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5],
+               ptr[6], ptr[7], ptr[8], ptr[9], ptr[10], ptr[11], ptr[12],
+               ptr[13], ptr[14], ptr[15]);
 #endif
-    pUmDevice->tx_pkt = 0;
-    QQ_PushHead(&pDevice->TxPacketFreeQ.Container, pPacket);
+       pUmDevice->tx_pkt = 0;
+       QQ_PushHead (&pDevice->TxPacketFreeQ.Container, pPacket);
 
-    /* Done with send */
- out:
-    return status;
+       /* Done with send */
     out:
+       return status;
 }
 
-
 /* Ethernet receive */
-int
-eth_rx(void)
+int eth_rx (void)
 {
-    PLM_PACKET          pPacket = NULL;
-    PUM_PACKET          pUmPacket = NULL;
-    void *skb;
-    int size=0;
+       PLM_PACKET pPacket = NULL;
+       PUM_PACKET pUmPacket = NULL;
+       void *skb;
+       int size = 0;
 
-    while(TRUE) {
+       while (TRUE) {
 
-    bcm570x_service_isr:
-       /* Pull down packet if it is there */
-       eth_isr();
+             bcm570x_service_isr:
+               /* Pull down packet if it is there */
+               eth_isr ();
 
-       /* Indicate RX packets called */
-       if(pUmDevice->rx_pkt){
-           /* printf("eth_rx: got a packet...\n"); */
-           pUmDevice->rx_pkt = 0;
-       } else {
-           /* printf("eth_rx: waiting for packet...\n"); */
-           goto bcm570x_service_isr;
-       }
+               /* Indicate RX packets called */
+               if (pUmDevice->rx_pkt) {
+                       /* printf("eth_rx: got a packet...\n"); */
+                       pUmDevice->rx_pkt = 0;
+               } else {
+                       /* printf("eth_rx: waiting for packet...\n"); */
+                       goto bcm570x_service_isr;
+               }
 
-       pPacket = (PLM_PACKET)
-           QQ_PopHead(&pDevice->RxPacketReceivedQ.Container);
+               pPacket = (PLM_PACKET)
+                   QQ_PopHead (&pDevice->RxPacketReceivedQ.Container);
 
-       if (pPacket == 0){
-           printf("eth_rx: empty packet!\n");
-           goto bcm570x_service_isr;
-       }
+               if (pPacket == 0) {
+                       printf ("eth_rx: empty packet!\n");
+                       goto bcm570x_service_isr;
+               }
 
-       pUmPacket = (PUM_PACKET) pPacket;
+               pUmPacket = (PUM_PACKET) pPacket;
 #if ET_DEBUG
-       printf("eth_rx: packet @0x%x\n",
-              (int)pPacket);
+               printf ("eth_rx: packet @0x%x\n", (int)pPacket);
 #endif
-       /* If the packet generated an error, reuse buffer */
-       if ((pPacket->PacketStatus != LM_STATUS_SUCCESS) ||
-           ((size = pPacket->PacketSize) > pDevice->RxMtu)) {
-
-           /* reuse skb */
-           QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket);
-           printf("eth_rx: error in packet dma!\n");
-           goto bcm570x_service_isr;
-       }
+               /* If the packet generated an error, reuse buffer */
+               if ((pPacket->PacketStatus != LM_STATUS_SUCCESS) ||
+                   ((size = pPacket->PacketSize) > pDevice->RxMtu)) {
+
+                       /* reuse skb */
+                       QQ_PushTail (&pDevice->RxPacketFreeQ.Container,
+                                    pPacket);
+                       printf ("eth_rx: error in packet dma!\n");
+                       goto bcm570x_service_isr;
+               }
 
-       /* Set size and address */
-       skb = pUmPacket->skbuff;
-       size = pPacket->PacketSize;
+               /* Set size and address */
+               skb = pUmPacket->skbuff;
+               size = pPacket->PacketSize;
 
-       /* Pass the packet up to the protocol
-        * layers.
-        */
-       NetReceive(skb, size);
+               /* Pass the packet up to the protocol
+                * layers.
+                */
+               NetReceive (skb, size);
 
-       /* Free packet buffer */
-       bcm570xPktFree (pUmDevice->index, skb);
-       pUmPacket->skbuff = NULL;
+               /* Free packet buffer */
+               bcm570xPktFree (pUmDevice->index, skb);
+               pUmPacket->skbuff = NULL;
 
-       /* Reuse SKB */
-       QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket);
+               /* Reuse SKB */
+               QQ_PushTail (&pDevice->RxPacketFreeQ.Container, pPacket);
 
-       return 0; /* Got a packet, bail ... */
-    }
-    return size;
+               return 0;       /* Got a packet, bail ... */
+       }
+       return size;
 }
 
-
 /* Shut down device */
-void
-eth_halt(void)
+void eth_halt (void)
 {
-    int i;
-    if ( initialized)
-    if (pDevice && pUmDevice && pUmDevice->opened){
-       printf("\neth%d:%s,", pUmDevice->index, pUmDevice->name);
-       printf("HALT,");
-       /* stop device */
-       LM_Halt(pDevice);
-       printf("POWER DOWN,");
-       LM_SetPowerState(pDevice, LM_POWER_STATE_D3);
-
-       /* Free the memory allocated by the device in tigon3 */
-       for (i = 0; i < pUmDevice->mem_list_num; i++)  {
-           if (pUmDevice->mem_list[i])  {
-               /* sanity check */
-               if (pUmDevice->dma_list[i]) {  /* cache-safe memory */
-                   free(pUmDevice->mem_list[i]);
-               } else {
-                   free(pUmDevice->mem_list[i]);  /* normal memory   */
+       int i;
+       if (initialized)
+               if (pDevice && pUmDevice && pUmDevice->opened) {
+                       printf ("\neth%d:%s,", pUmDevice->index,
+                               pUmDevice->name);
+                       printf ("HALT,");
+                       /* stop device */
+                       LM_Halt (pDevice);
+                       printf ("POWER DOWN,");
+                       LM_SetPowerState (pDevice, LM_POWER_STATE_D3);
+
+                       /* Free the memory allocated by the device in tigon3 */
+                       for (i = 0; i < pUmDevice->mem_list_num; i++) {
+                               if (pUmDevice->mem_list[i]) {
+                                       /* sanity check */
+                                       if (pUmDevice->dma_list[i]) {   /* cache-safe memory */
+                                               free (pUmDevice->mem_list[i]);
+                                       } else {
+                                               free (pUmDevice->mem_list[i]);  /* normal memory   */
+                                       }
+                               }
+                       }
+                       pUmDevice->opened = 0;
+                       free (pDevice);
+                       pDevice = NULL;
+                       pUmDevice = NULL;
+                       initialized = 0;
+                       printf ("done - offline.\n");
                }
-           }
-       }
-       pUmDevice->opened = 0;
-       free(pDevice);
-       pDevice = NULL;
-       pUmDevice = NULL;
-       initialized = 0;
-       printf("done - offline.\n");
-    }
 }
 
-
 /*
  *
  * Middle Module: Interface between the HW driver (tigon3 modules) and
@@ -843,409 +834,380 @@ eth_halt(void)
  */
 
 /* Middle module dependency - size of a packet descriptor */
-int MM_Packet_Desc_Size = sizeof(UM_PACKET);
-
+int MM_Packet_Desc_Size = sizeof (UM_PACKET);
 
 LM_STATUS
-MM_ReadConfig32(PLM_DEVICE_BLOCK pDevice,
-               LM_UINT32 Offset,
-               LM_UINT32 *pValue32)
+MM_ReadConfig32 (PLM_DEVICE_BLOCK pDevice,
+                LM_UINT32 Offset, LM_UINT32 * pValue32)
 {
-    UM_DEVICE_BLOCK *pUmDevice;
-    pUmDevice = (UM_DEVICE_BLOCK *) pDevice;
-    pci_read_config_dword(pUmDevice->pdev,
-                         Offset, (u32 *) pValue32);
-    return LM_STATUS_SUCCESS;
+       UM_DEVICE_BLOCK *pUmDevice;
+       pUmDevice = (UM_DEVICE_BLOCK *) pDevice;
+       pci_read_config_dword (pUmDevice->pdev, Offset, (u32 *) pValue32);
+       return LM_STATUS_SUCCESS;
 }
 
-
 LM_STATUS
-MM_WriteConfig32(PLM_DEVICE_BLOCK pDevice,
-                LM_UINT32 Offset,
-                LM_UINT32 Value32)
+MM_WriteConfig32 (PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset, LM_UINT32 Value32)
 {
-    UM_DEVICE_BLOCK *pUmDevice;
-    pUmDevice = (UM_DEVICE_BLOCK *) pDevice;
-    pci_write_config_dword(pUmDevice->pdev,
-                          Offset, Value32);
-    return LM_STATUS_SUCCESS;
+       UM_DEVICE_BLOCK *pUmDevice;
+       pUmDevice = (UM_DEVICE_BLOCK *) pDevice;
+       pci_write_config_dword (pUmDevice->pdev, Offset, Value32);
+       return LM_STATUS_SUCCESS;
 }
 
-
 LM_STATUS
-MM_ReadConfig16(PLM_DEVICE_BLOCK pDevice,
-               LM_UINT32 Offset,
-               LM_UINT16 *pValue16)
+MM_ReadConfig16 (PLM_DEVICE_BLOCK pDevice,
+                LM_UINT32 Offset, LM_UINT16 * pValue16)
 {
-    UM_DEVICE_BLOCK *pUmDevice;
-    pUmDevice = (UM_DEVICE_BLOCK *) pDevice;
-    pci_read_config_word(pUmDevice->pdev,
-                        Offset, (u16*) pValue16);
-    return LM_STATUS_SUCCESS;
+       UM_DEVICE_BLOCK *pUmDevice;
+       pUmDevice = (UM_DEVICE_BLOCK *) pDevice;
+       pci_read_config_word (pUmDevice->pdev, Offset, (u16 *) pValue16);
+       return LM_STATUS_SUCCESS;
 }
 
 LM_STATUS
-MM_WriteConfig16(PLM_DEVICE_BLOCK pDevice,
-                LM_UINT32 Offset,
-                LM_UINT16 Value16)
+MM_WriteConfig16 (PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset, LM_UINT16 Value16)
 {
-    UM_DEVICE_BLOCK *pUmDevice;
-    pUmDevice = (UM_DEVICE_BLOCK *) pDevice;
-    pci_write_config_word(pUmDevice->pdev,
-                         Offset, Value16);
-    return LM_STATUS_SUCCESS;
+       UM_DEVICE_BLOCK *pUmDevice;
+       pUmDevice = (UM_DEVICE_BLOCK *) pDevice;
+       pci_write_config_word (pUmDevice->pdev, Offset, Value16);
+       return LM_STATUS_SUCCESS;
 }
 
-
 LM_STATUS
-MM_AllocateSharedMemory(PLM_DEVICE_BLOCK pDevice, LM_UINT32 BlockSize,
-                       PLM_VOID *pMemoryBlockVirt,
-                       PLM_PHYSICAL_ADDRESS pMemoryBlockPhy,
-                       LM_BOOL Cached)
+MM_AllocateSharedMemory (PLM_DEVICE_BLOCK pDevice, LM_UINT32 BlockSize,
+                        PLM_VOID * pMemoryBlockVirt,
+                        PLM_PHYSICAL_ADDRESS pMemoryBlockPhy, LM_BOOL Cached)
 {
-    PLM_VOID pvirt;
-    PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
-    dma_addr_t mapping;
+       PLM_VOID pvirt;
+       PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
+       dma_addr_t mapping;
 
-    pvirt = malloc(BlockSize);
-    mapping = (dma_addr_t)(pvirt);
-    if (!pvirt)
-       return LM_STATUS_FAILURE;
+       pvirt = malloc (BlockSize);
+       mapping = (dma_addr_t) (pvirt);
+       if (!pvirt)
+               return LM_STATUS_FAILURE;
 
-    pUmDevice->mem_list[pUmDevice->mem_list_num] = pvirt;
-    pUmDevice->dma_list[pUmDevice->mem_list_num] = mapping;
-    pUmDevice->mem_size_list[pUmDevice->mem_list_num++] = BlockSize;
-    memset(pvirt, 0, BlockSize);
+       pUmDevice->mem_list[pUmDevice->mem_list_num] = pvirt;
+       pUmDevice->dma_list[pUmDevice->mem_list_num] = mapping;
+       pUmDevice->mem_size_list[pUmDevice->mem_list_num++] = BlockSize;
+       memset (pvirt, 0, BlockSize);
 
-    *pMemoryBlockVirt = (PLM_VOID) pvirt;
-    MM_SetAddr (pMemoryBlockPhy, (dma_addr_t) mapping);
+       *pMemoryBlockVirt = (PLM_VOID) pvirt;
+       MM_SetAddr (pMemoryBlockPhy, (dma_addr_t) mapping);
 
-    return LM_STATUS_SUCCESS;
+       return LM_STATUS_SUCCESS;
 }
 
-
 LM_STATUS
-MM_AllocateMemory(PLM_DEVICE_BLOCK pDevice, LM_UINT32 BlockSize,
-       PLM_VOID *pMemoryBlockVirt)
+MM_AllocateMemory (PLM_DEVICE_BLOCK pDevice, LM_UINT32 BlockSize,
+                  PLM_VOID * pMemoryBlockVirt)
 {
-    PLM_VOID pvirt;
-    PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
+       PLM_VOID pvirt;
+       PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
 
-    pvirt = malloc(BlockSize);
+       pvirt = malloc (BlockSize);
 
-    if (!pvirt)
-       return LM_STATUS_FAILURE;
+       if (!pvirt)
+               return LM_STATUS_FAILURE;
 
-    pUmDevice->mem_list[pUmDevice->mem_list_num] = pvirt;
-    pUmDevice->dma_list[pUmDevice->mem_list_num] = 0;
-    pUmDevice->mem_size_list[pUmDevice->mem_list_num++] = BlockSize;
-    memset(pvirt, 0, BlockSize);
-    *pMemoryBlockVirt = pvirt;
+       pUmDevice->mem_list[pUmDevice->mem_list_num] = pvirt;
+       pUmDevice->dma_list[pUmDevice->mem_list_num] = 0;
+       pUmDevice->mem_size_list[pUmDevice->mem_list_num++] = BlockSize;
+       memset (pvirt, 0, BlockSize);
+       *pMemoryBlockVirt = pvirt;
 
-    return LM_STATUS_SUCCESS;
+       return LM_STATUS_SUCCESS;
 }
 
-LM_STATUS
-MM_MapMemBase(PLM_DEVICE_BLOCK pDevice)
+LM_STATUS MM_MapMemBase (PLM_DEVICE_BLOCK pDevice)
 {
-    printf("BCM570x PCI Memory base address @0x%x\n",
-          (unsigned int)pDevice->pMappedMemBase);
-    return LM_STATUS_SUCCESS;
+       printf ("BCM570x PCI Memory base address @0x%x\n",
+               (unsigned int)pDevice->pMappedMemBase);
+       return LM_STATUS_SUCCESS;
 }
 
-LM_STATUS
-MM_InitializeUmPackets(PLM_DEVICE_BLOCK pDevice)
+LM_STATUS MM_InitializeUmPackets (PLM_DEVICE_BLOCK pDevice)
 {
-    int i;
-    void* skb;
-    PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
-    PUM_PACKET pUmPacket = NULL;
-    PLM_PACKET pPacket = NULL;
-
-    for (i = 0; i < pDevice->RxPacketDescCnt; i++) {
-       pPacket = QQ_PopHead(&pDevice->RxPacketFreeQ.Container);
-       pUmPacket = (PUM_PACKET) pPacket;
+       int i;
+       void *skb;
+       PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
+       PUM_PACKET pUmPacket = NULL;
+       PLM_PACKET pPacket = NULL;
+
+       for (i = 0; i < pDevice->RxPacketDescCnt; i++) {
+               pPacket = QQ_PopHead (&pDevice->RxPacketFreeQ.Container);
+               pUmPacket = (PUM_PACKET) pPacket;
+
+               if (pPacket == 0) {
+                       printf ("MM_InitializeUmPackets: Bad RxPacketFreeQ\n");
+               }
 
-       if (pPacket == 0) {
-           printf("MM_InitializeUmPackets: Bad RxPacketFreeQ\n");
-       }
+               skb = bcm570xPktAlloc (pUmDevice->index,
+                                      pPacket->u.Rx.RxBufferSize + 2);
 
-       skb = bcm570xPktAlloc(pUmDevice->index,
-                             pPacket->u.Rx.RxBufferSize + 2);
+               if (skb == 0) {
+                       pUmPacket->skbuff = 0;
+                       QQ_PushTail (&pUmDevice->rx_out_of_buf_q.Container,
+                                    pPacket);
+                       printf ("MM_InitializeUmPackets: out of buffer.\n");
+                       continue;
+               }
 
-       if (skb == 0) {
-           pUmPacket->skbuff = 0;
-           QQ_PushTail(&pUmDevice->rx_out_of_buf_q.Container, pPacket);
-           printf("MM_InitializeUmPackets: out of buffer.\n");
-           continue;
+               pUmPacket->skbuff = skb;
+               QQ_PushTail (&pDevice->RxPacketFreeQ.Container, pPacket);
        }
 
-       pUmPacket->skbuff = skb;
-       QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket);
-    }
-
-    pUmDevice->rx_low_buf_thresh = pDevice->RxPacketDescCnt / 8;
+       pUmDevice->rx_low_buf_thresh = pDevice->RxPacketDescCnt / 8;
 
-    return LM_STATUS_SUCCESS;
+       return LM_STATUS_SUCCESS;
 }
 
-LM_STATUS
-MM_GetConfig(PLM_DEVICE_BLOCK pDevice)
+LM_STATUS MM_GetConfig (PLM_DEVICE_BLOCK pDevice)
 {
-    PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
-    int index = pDevice->index;
-
-    if (auto_speed[index] == 0)
-       pDevice->DisableAutoNeg = TRUE;
-    else
-       pDevice->DisableAutoNeg = FALSE;
-
-    if (line_speed[index] == 0) {
-       pDevice->RequestedMediaType =
-           LM_REQUESTED_MEDIA_TYPE_AUTO;
-       pDevice->DisableAutoNeg = FALSE;
-    }
-    else {
-       if (line_speed[index] == 1000) {
-           if (pDevice->EnableTbi) {
-               pDevice->RequestedMediaType =
-                   LM_REQUESTED_MEDIA_TYPE_FIBER_1000MBPS_FULL_DUPLEX;
-           }
-           else if (full_duplex[index]) {
-               pDevice->RequestedMediaType =
-                   LM_REQUESTED_MEDIA_TYPE_UTP_1000MBPS_FULL_DUPLEX;
-           }
-           else {
-               pDevice->RequestedMediaType =
-                   LM_REQUESTED_MEDIA_TYPE_UTP_1000MBPS;
-           }
-           if (!pDevice->EnableTbi)
+       PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
+       int index = pDevice->index;
+
+       if (auto_speed[index] == 0)
+               pDevice->DisableAutoNeg = TRUE;
+       else
                pDevice->DisableAutoNeg = FALSE;
+
+       if (line_speed[index] == 0) {
+               pDevice->RequestedMediaType = LM_REQUESTED_MEDIA_TYPE_AUTO;
+               pDevice->DisableAutoNeg = FALSE;
+       } else {
+               if (line_speed[index] == 1000) {
+                       if (pDevice->EnableTbi) {
+                               pDevice->RequestedMediaType =
+                                   LM_REQUESTED_MEDIA_TYPE_FIBER_1000MBPS_FULL_DUPLEX;
+                       } else if (full_duplex[index]) {
+                               pDevice->RequestedMediaType =
+                                   LM_REQUESTED_MEDIA_TYPE_UTP_1000MBPS_FULL_DUPLEX;
+                       } else {
+                               pDevice->RequestedMediaType =
+                                   LM_REQUESTED_MEDIA_TYPE_UTP_1000MBPS;
+                       }
+                       if (!pDevice->EnableTbi)
+                               pDevice->DisableAutoNeg = FALSE;
+               } else if (line_speed[index] == 100) {
+                       if (full_duplex[index]) {
+                               pDevice->RequestedMediaType =
+                                   LM_REQUESTED_MEDIA_TYPE_UTP_100MBPS_FULL_DUPLEX;
+                       } else {
+                               pDevice->RequestedMediaType =
+                                   LM_REQUESTED_MEDIA_TYPE_UTP_100MBPS;
+                       }
+               } else if (line_speed[index] == 10) {
+                       if (full_duplex[index]) {
+                               pDevice->RequestedMediaType =
+                                   LM_REQUESTED_MEDIA_TYPE_UTP_10MBPS_FULL_DUPLEX;
+                       } else {
+                               pDevice->RequestedMediaType =
+                                   LM_REQUESTED_MEDIA_TYPE_UTP_10MBPS;
+                       }
+               } else {
+                       pDevice->RequestedMediaType =
+                           LM_REQUESTED_MEDIA_TYPE_AUTO;
+                       pDevice->DisableAutoNeg = FALSE;
+               }
+
        }
-       else if (line_speed[index] == 100) {
-           if (full_duplex[index]) {
-               pDevice->RequestedMediaType =
-                   LM_REQUESTED_MEDIA_TYPE_UTP_100MBPS_FULL_DUPLEX;
-           }
-           else {
-               pDevice->RequestedMediaType =
-                   LM_REQUESTED_MEDIA_TYPE_UTP_100MBPS;
-           }
-       }
-       else if (line_speed[index] == 10) {
-           if (full_duplex[index]) {
-               pDevice->RequestedMediaType =
-                   LM_REQUESTED_MEDIA_TYPE_UTP_10MBPS_FULL_DUPLEX;
-           }
-           else {
-               pDevice->RequestedMediaType =
-                   LM_REQUESTED_MEDIA_TYPE_UTP_10MBPS;
-           }
+       pDevice->FlowControlCap = 0;
+       if (rx_flow_control[index] != 0) {
+               pDevice->FlowControlCap |= LM_FLOW_CONTROL_RECEIVE_PAUSE;
        }
-       else {
-           pDevice->RequestedMediaType =
-               LM_REQUESTED_MEDIA_TYPE_AUTO;
-           pDevice->DisableAutoNeg = FALSE;
+       if (tx_flow_control[index] != 0) {
+               pDevice->FlowControlCap |= LM_FLOW_CONTROL_TRANSMIT_PAUSE;
        }
-
-    }
-    pDevice->FlowControlCap = 0;
-    if (rx_flow_control[index] != 0) {
-       pDevice->FlowControlCap |= LM_FLOW_CONTROL_RECEIVE_PAUSE;
-    }
-    if (tx_flow_control[index] != 0) {
-       pDevice->FlowControlCap |= LM_FLOW_CONTROL_TRANSMIT_PAUSE;
-    }
-    if ((auto_flow_control[index] != 0) &&
-       (pDevice->DisableAutoNeg == FALSE)) {
-
-       pDevice->FlowControlCap |= LM_FLOW_CONTROL_AUTO_PAUSE;
-       if ((tx_flow_control[index] == 0) &&
-           (rx_flow_control[index] == 0)) {
-           pDevice->FlowControlCap |=
-               LM_FLOW_CONTROL_TRANSMIT_PAUSE |
-               LM_FLOW_CONTROL_RECEIVE_PAUSE;
+       if ((auto_flow_control[index] != 0) &&
+           (pDevice->DisableAutoNeg == FALSE)) {
+
+               pDevice->FlowControlCap |= LM_FLOW_CONTROL_AUTO_PAUSE;
+               if ((tx_flow_control[index] == 0) &&
+                   (rx_flow_control[index] == 0)) {
+                       pDevice->FlowControlCap |=
+                           LM_FLOW_CONTROL_TRANSMIT_PAUSE |
+                           LM_FLOW_CONTROL_RECEIVE_PAUSE;
+               }
        }
-    }
 
-    /* Default MTU for now */
-    pUmDevice->mtu = 1500;
+       /* Default MTU for now */
+       pUmDevice->mtu = 1500;
 
 #if T3_JUMBO_RCV_RCB_ENTRY_COUNT
-    if (pUmDevice->mtu > 1500) {
-       pDevice->RxMtu = pUmDevice->mtu;
-       pDevice->RxJumboDescCnt = DEFAULT_JUMBO_RCV_DESC_COUNT;
-    }
-    else {
-       pDevice->RxJumboDescCnt = 0;
-    }
-    pDevice->RxJumboDescCnt = rx_jumbo_desc_cnt[index];
+       if (pUmDevice->mtu > 1500) {
+               pDevice->RxMtu = pUmDevice->mtu;
+               pDevice->RxJumboDescCnt = DEFAULT_JUMBO_RCV_DESC_COUNT;
+       } else {
+               pDevice->RxJumboDescCnt = 0;
+       }
+       pDevice->RxJumboDescCnt = rx_jumbo_desc_cnt[index];
 #else
-    pDevice->RxMtu = pUmDevice->mtu;
+       pDevice->RxMtu = pUmDevice->mtu;
 #endif
 
-    if (T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701) {
-       pDevice->UseTaggedStatus = TRUE;
-       pUmDevice->timer_interval = CFG_HZ;
-    }
-    else {
-       pUmDevice->timer_interval = CFG_HZ/50;
-    }
-
-    pDevice->TxPacketDescCnt = tx_pkt_desc_cnt[index];
-    pDevice->RxStdDescCnt = rx_std_desc_cnt[index];
-    /* Note:  adaptive coalescence really isn't adaptive in this driver */
-    pUmDevice->rx_adaptive_coalesce = rx_adaptive_coalesce[index];
-    if (!pUmDevice->rx_adaptive_coalesce) {
-       pDevice->RxCoalescingTicks = rx_coalesce_ticks[index];
-       if (pDevice->RxCoalescingTicks > MAX_RX_COALESCING_TICKS)
-           pDevice->RxCoalescingTicks = MAX_RX_COALESCING_TICKS;
-       pUmDevice->rx_curr_coalesce_ticks =pDevice->RxCoalescingTicks;
-
-       pDevice->RxMaxCoalescedFrames = rx_max_coalesce_frames[index];
-       if (pDevice->RxMaxCoalescedFrames>MAX_RX_MAX_COALESCED_FRAMES)
-           pDevice->RxMaxCoalescedFrames =
-                               MAX_RX_MAX_COALESCED_FRAMES;
-       pUmDevice->rx_curr_coalesce_frames =
-           pDevice->RxMaxCoalescedFrames;
-       pDevice->StatsCoalescingTicks = stats_coalesce_ticks[index];
-       if (pDevice->StatsCoalescingTicks>MAX_STATS_COALESCING_TICKS)
-           pDevice->StatsCoalescingTicks=
-               MAX_STATS_COALESCING_TICKS;
-       }
-       else {
-           pUmDevice->rx_curr_coalesce_frames =
-               DEFAULT_RX_MAX_COALESCED_FRAMES;
-           pUmDevice->rx_curr_coalesce_ticks =
-               DEFAULT_RX_COALESCING_TICKS;
+       if (T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5701) {
+               pDevice->UseTaggedStatus = TRUE;
+               pUmDevice->timer_interval = CFG_HZ;
+       } else {
+               pUmDevice->timer_interval = CFG_HZ / 50;
        }
-    pDevice->TxCoalescingTicks = tx_coalesce_ticks[index];
-    if (pDevice->TxCoalescingTicks > MAX_TX_COALESCING_TICKS)
-       pDevice->TxCoalescingTicks = MAX_TX_COALESCING_TICKS;
-    pDevice->TxMaxCoalescedFrames = tx_max_coalesce_frames[index];
-    if (pDevice->TxMaxCoalescedFrames > MAX_TX_MAX_COALESCED_FRAMES)
-       pDevice->TxMaxCoalescedFrames = MAX_TX_MAX_COALESCED_FRAMES;
 
-    if (enable_wol[index]) {
-       pDevice->WakeUpModeCap = LM_WAKE_UP_MODE_MAGIC_PACKET;
-       pDevice->WakeUpMode = LM_WAKE_UP_MODE_MAGIC_PACKET;
-    }
-    pDevice->NicSendBd = TRUE;
+       pDevice->TxPacketDescCnt = tx_pkt_desc_cnt[index];
+       pDevice->RxStdDescCnt = rx_std_desc_cnt[index];
+       /* Note:  adaptive coalescence really isn't adaptive in this driver */
+       pUmDevice->rx_adaptive_coalesce = rx_adaptive_coalesce[index];
+       if (!pUmDevice->rx_adaptive_coalesce) {
+               pDevice->RxCoalescingTicks = rx_coalesce_ticks[index];
+               if (pDevice->RxCoalescingTicks > MAX_RX_COALESCING_TICKS)
+                       pDevice->RxCoalescingTicks = MAX_RX_COALESCING_TICKS;
+               pUmDevice->rx_curr_coalesce_ticks = pDevice->RxCoalescingTicks;
+
+               pDevice->RxMaxCoalescedFrames = rx_max_coalesce_frames[index];
+               if (pDevice->RxMaxCoalescedFrames > MAX_RX_MAX_COALESCED_FRAMES)
+                       pDevice->RxMaxCoalescedFrames =
+                           MAX_RX_MAX_COALESCED_FRAMES;
+               pUmDevice->rx_curr_coalesce_frames =
+                   pDevice->RxMaxCoalescedFrames;
+               pDevice->StatsCoalescingTicks = stats_coalesce_ticks[index];
+               if (pDevice->StatsCoalescingTicks > MAX_STATS_COALESCING_TICKS)
+                       pDevice->StatsCoalescingTicks =
+                           MAX_STATS_COALESCING_TICKS;
+       } else {
+               pUmDevice->rx_curr_coalesce_frames =
+                   DEFAULT_RX_MAX_COALESCED_FRAMES;
+               pUmDevice->rx_curr_coalesce_ticks = DEFAULT_RX_COALESCING_TICKS;
+       }
+       pDevice->TxCoalescingTicks = tx_coalesce_ticks[index];
+       if (pDevice->TxCoalescingTicks > MAX_TX_COALESCING_TICKS)
+               pDevice->TxCoalescingTicks = MAX_TX_COALESCING_TICKS;
+       pDevice->TxMaxCoalescedFrames = tx_max_coalesce_frames[index];
+       if (pDevice->TxMaxCoalescedFrames > MAX_TX_MAX_COALESCED_FRAMES)
+               pDevice->TxMaxCoalescedFrames = MAX_TX_MAX_COALESCED_FRAMES;
+
+       if (enable_wol[index]) {
+               pDevice->WakeUpModeCap = LM_WAKE_UP_MODE_MAGIC_PACKET;
+               pDevice->WakeUpMode = LM_WAKE_UP_MODE_MAGIC_PACKET;
+       }
+       pDevice->NicSendBd = TRUE;
 
-    /* Don't update status blocks during interrupt */
-    pDevice->RxCoalescingTicksDuringInt = 0;
-    pDevice->TxCoalescingTicksDuringInt = 0;
+       /* Don't update status blocks during interrupt */
+       pDevice->RxCoalescingTicksDuringInt = 0;
+       pDevice->TxCoalescingTicksDuringInt = 0;
 
-    return LM_STATUS_SUCCESS;
+       return LM_STATUS_SUCCESS;
 
 }
 
-
-LM_STATUS
-MM_StartTxDma(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket)
+LM_STATUS MM_StartTxDma (PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket)
 {
-    PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
-    printf("Start TX DMA: dev=%d packet @0x%x\n",
-          (int)pUmDevice->index, (unsigned int)pPacket);
+       PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
+       printf ("Start TX DMA: dev=%d packet @0x%x\n",
+               (int)pUmDevice->index, (unsigned int)pPacket);
 
-    return LM_STATUS_SUCCESS;
+       return LM_STATUS_SUCCESS;
 }
 
-LM_STATUS
-MM_CompleteTxDma(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket)
+LM_STATUS MM_CompleteTxDma (PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket)
 {
-    PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
-    printf("Complete TX DMA: dev=%d packet @0x%x\n",
-          (int)pUmDevice->index, (unsigned int)pPacket);
-    return LM_STATUS_SUCCESS;
+       PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
+       printf ("Complete TX DMA: dev=%d packet @0x%x\n",
+               (int)pUmDevice->index, (unsigned int)pPacket);
+       return LM_STATUS_SUCCESS;
 }
 
-
-LM_STATUS
-MM_IndicateStatus(PLM_DEVICE_BLOCK pDevice, LM_STATUS Status)
+LM_STATUS MM_IndicateStatus (PLM_DEVICE_BLOCK pDevice, LM_STATUS Status)
 {
-    char buf[128];
-    char lcd[4];
-    PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
-    LM_FLOW_CONTROL flow_control;
-
-    pUmDevice->delayed_link_ind = 0;
-    memset(lcd, 0x0, 4);
-
-    if (Status == LM_STATUS_LINK_DOWN) {
-       sprintf(buf,"eth%d: %s: NIC Link is down\n",
-               pUmDevice->index,pUmDevice->name);
-       lcd[0] = 'L';lcd[1]='N';lcd[2]='K';lcd[3] = '?';
-    } else if (Status == LM_STATUS_LINK_ACTIVE) {
-       sprintf(buf,"eth%d:%s: ", pUmDevice->index, pUmDevice->name);
-
-       if (pDevice->LineSpeed == LM_LINE_SPEED_1000MBPS){
-           strcat(buf,"1000 Mbps ");
-           lcd[0] = '1';lcd[1]='G';lcd[2]='B';
-       } else if (pDevice->LineSpeed == LM_LINE_SPEED_100MBPS){
-           strcat(buf,"100 Mbps ");
-           lcd[0] = '1';lcd[1]='0';lcd[2]='0';
-       } else if (pDevice->LineSpeed == LM_LINE_SPEED_10MBPS){
-           strcat(buf,"10 Mbps ");
-           lcd[0] = '1';lcd[1]='0';lcd[2]=' ';
-       }
-       if (pDevice->DuplexMode == LM_DUPLEX_MODE_FULL){
-           strcat(buf, "full duplex");
-           lcd[3] = 'F';
-       } else {
-           strcat(buf, "half duplex");
-           lcd[3] = 'H';
-       }
-       strcat(buf, " link up");
-
-       flow_control = pDevice->FlowControl &
-           (LM_FLOW_CONTROL_RECEIVE_PAUSE |
-            LM_FLOW_CONTROL_TRANSMIT_PAUSE);
-
-       if (flow_control) {
-           if (flow_control & LM_FLOW_CONTROL_RECEIVE_PAUSE) {
-               strcat(buf,", receive ");
-               if (flow_control & LM_FLOW_CONTROL_TRANSMIT_PAUSE)
-                   strcat(buf," & transmit ");
-           }
-           else {
-               strcat(buf,", transmit ");
-           }
-           strcat(buf,"flow control ON");
-       } else {
-           strcat(buf, ", flow control OFF");
+       char buf[128];
+       char lcd[4];
+       PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
+       LM_FLOW_CONTROL flow_control;
+
+       pUmDevice->delayed_link_ind = 0;
+       memset (lcd, 0x0, 4);
+
+       if (Status == LM_STATUS_LINK_DOWN) {
+               sprintf (buf, "eth%d: %s: NIC Link is down\n",
+                        pUmDevice->index, pUmDevice->name);
+               lcd[0] = 'L';
+               lcd[1] = 'N';
+               lcd[2] = 'K';
+               lcd[3] = '?';
+       } else if (Status == LM_STATUS_LINK_ACTIVE) {
+               sprintf (buf, "eth%d:%s: ", pUmDevice->index, pUmDevice->name);
+
+               if (pDevice->LineSpeed == LM_LINE_SPEED_1000MBPS) {
+                       strcat (buf, "1000 Mbps ");
+                       lcd[0] = '1';
+                       lcd[1] = 'G';
+                       lcd[2] = 'B';
+               } else if (pDevice->LineSpeed == LM_LINE_SPEED_100MBPS) {
+                       strcat (buf, "100 Mbps ");
+                       lcd[0] = '1';
+                       lcd[1] = '0';
+                       lcd[2] = '0';
+               } else if (pDevice->LineSpeed == LM_LINE_SPEED_10MBPS) {
+                       strcat (buf, "10 Mbps ");
+                       lcd[0] = '1';
+                       lcd[1] = '0';
+                       lcd[2] = ' ';
+               }
+               if (pDevice->DuplexMode == LM_DUPLEX_MODE_FULL) {
+                       strcat (buf, "full duplex");
+                       lcd[3] = 'F';
+               } else {
+                       strcat (buf, "half duplex");
+                       lcd[3] = 'H';
+               }
+               strcat (buf, " link up");
+
+               flow_control = pDevice->FlowControl &
+                   (LM_FLOW_CONTROL_RECEIVE_PAUSE |
+                    LM_FLOW_CONTROL_TRANSMIT_PAUSE);
+
+               if (flow_control) {
+                       if (flow_control & LM_FLOW_CONTROL_RECEIVE_PAUSE) {
+                               strcat (buf, ", receive ");
+                               if (flow_control &
+                                   LM_FLOW_CONTROL_TRANSMIT_PAUSE)
+                                       strcat (buf, " & transmit ");
+                       } else {
+                               strcat (buf, ", transmit ");
+                       }
+                       strcat (buf, "flow control ON");
+               } else {
+                       strcat (buf, ", flow control OFF");
+               }
+               strcat (buf, "\n");
+               printf ("%s", buf);
        }
-       strcat(buf,"\n");
-       printf("%s",buf);
-    }
 #if 0
-    sysLedDsply(lcd[0],lcd[1],lcd[2],lcd[3]);
+       sysLedDsply (lcd[0], lcd[1], lcd[2], lcd[3]);
 #endif
-    return LM_STATUS_SUCCESS;
+       return LM_STATUS_SUCCESS;
 }
 
-LM_STATUS
-MM_FreeRxBuffer(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket)
+LM_STATUS MM_FreeRxBuffer (PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket)
 {
 
-    PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
-    PUM_PACKET pUmPacket;
-    void *skb;
+       PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
+       PUM_PACKET pUmPacket;
+       void *skb;
 
-    pUmPacket = (PUM_PACKET) pPacket;
+       pUmPacket = (PUM_PACKET) pPacket;
 
-    if ((skb = pUmPacket->skbuff))
-       bcm570xPktFree(pUmDevice->index, skb);
+       if ((skb = pUmPacket->skbuff))
+               bcm570xPktFree (pUmDevice->index, skb);
 
-    pUmPacket->skbuff = 0;
+       pUmPacket->skbuff = 0;
 
-    return LM_STATUS_SUCCESS;
+       return LM_STATUS_SUCCESS;
 }
 
-unsigned long
-MM_AnGetCurrentTime_us(PAN_STATE_INFO pAnInfo)
+unsigned long MM_AnGetCurrentTime_us (PAN_STATE_INFO pAnInfo)
 {
-    return get_timer(0);
+       return get_timer (0);
 }
 
 /*
@@ -1258,86 +1220,82 @@ MM_AnGetCurrentTime_us(PAN_STATE_INFO pAnInfo)
  *   non-fatal.  The incoming cluster chain is not freed, giving
  *   the caller the choice of whether to try a retransmit later.
  */
-LM_STATUS
-MM_CoalesceTxBuffer(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket)
+LM_STATUS MM_CoalesceTxBuffer (PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket)
 {
-    PUM_PACKET pUmPacket = (PUM_PACKET) pPacket;
-    PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
-    void *skbnew;
-    int len = 0;
-
-    if (len == 0)
-       return (LM_STATUS_SUCCESS);
-
-    if (len > MAX_PACKET_SIZE){
-       printf ("eth%d: xmit frame discarded, too big!, size = %d\n",
-               pUmDevice->index, len);
-       return (LM_STATUS_FAILURE);
-    }
+       PUM_PACKET pUmPacket = (PUM_PACKET) pPacket;
+       PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
+       void *skbnew;
+       int len = 0;
+
+       if (len == 0)
+               return (LM_STATUS_SUCCESS);
+
+       if (len > MAX_PACKET_SIZE) {
+               printf ("eth%d: xmit frame discarded, too big!, size = %d\n",
+                       pUmDevice->index, len);
+               return (LM_STATUS_FAILURE);
+       }
 
-    skbnew = bcm570xPktAlloc(pUmDevice->index, MAX_PACKET_SIZE);
+       skbnew = bcm570xPktAlloc (pUmDevice->index, MAX_PACKET_SIZE);
 
-    if (skbnew == NULL) {
-       pUmDevice->tx_full = 1;
-       printf ("eth%d: out of transmit buffers", pUmDevice->index);
-       return (LM_STATUS_FAILURE);
-    }
+       if (skbnew == NULL) {
+               pUmDevice->tx_full = 1;
+               printf ("eth%d: out of transmit buffers", pUmDevice->index);
+               return (LM_STATUS_FAILURE);
+       }
 
-    /* New packet values */
-    pUmPacket->skbuff = skbnew;
-    pUmPacket->lm_packet.u.Tx.FragCount = 1;
+       /* New packet values */
+       pUmPacket->skbuff = skbnew;
+       pUmPacket->lm_packet.u.Tx.FragCount = 1;
 
-    return (LM_STATUS_SUCCESS);
+       return (LM_STATUS_SUCCESS);
 }
 
-
-LM_STATUS
-MM_IndicateRxPackets(PLM_DEVICE_BLOCK pDevice)
+LM_STATUS MM_IndicateRxPackets (PLM_DEVICE_BLOCK pDevice)
 {
-    PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
-    pUmDevice->rx_pkt = 1;
-    return LM_STATUS_SUCCESS;
+       PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
+       pUmDevice->rx_pkt = 1;
+       return LM_STATUS_SUCCESS;
 }
 
-LM_STATUS
-MM_IndicateTxPackets(PLM_DEVICE_BLOCK pDevice)
+LM_STATUS MM_IndicateTxPackets (PLM_DEVICE_BLOCK pDevice)
 {
-    PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
-    PLM_PACKET pPacket;
-    PUM_PACKET pUmPacket;
-    void *skb;
-    while ( TRUE ) {
-
-       pPacket = (PLM_PACKET)
-           QQ_PopHead(&pDevice->TxPacketXmittedQ.Container);
-
-       if (pPacket == 0)
-           break;
-
-       pUmPacket = (PUM_PACKET) pPacket;
-       skb = (void*)pUmPacket->skbuff;
-
-       /*
-       * Free MBLK if we transmitted a fragmented packet or a
-       * non-fragmented packet straight from the VxWorks
-       * buffer pool. If packet was copied to a local transmit
-       * buffer, then there's no MBUF to free, just free
-       * the transmit buffer back to the cluster pool.
-       */
-
-       if (skb)
-           bcm570xPktFree (pUmDevice->index, skb);
-
-       pUmPacket->skbuff = 0;
-       QQ_PushTail(&pDevice->TxPacketFreeQ.Container, pPacket);
-       pUmDevice->tx_pkt = 1;
-    }
-    if (pUmDevice->tx_full) {
-       if (QQ_GetEntryCnt(&pDevice->TxPacketFreeQ.Container) >=
-           (QQ_GetSize(&pDevice->TxPacketFreeQ.Container) >> 1))
-           pUmDevice->tx_full = 0;
-    }
-    return LM_STATUS_SUCCESS;
+       PUM_DEVICE_BLOCK pUmDevice = (PUM_DEVICE_BLOCK) pDevice;
+       PLM_PACKET pPacket;
+       PUM_PACKET pUmPacket;
+       void *skb;
+       while (TRUE) {
+
+               pPacket = (PLM_PACKET)
+                   QQ_PopHead (&pDevice->TxPacketXmittedQ.Container);
+
+               if (pPacket == 0)
+                       break;
+
+               pUmPacket = (PUM_PACKET) pPacket;
+               skb = (void *)pUmPacket->skbuff;
+
+               /*
+                * Free MBLK if we transmitted a fragmented packet or a
+                * non-fragmented packet straight from the VxWorks
+                * buffer pool. If packet was copied to a local transmit
+                * buffer, then there's no MBUF to free, just free
+                * the transmit buffer back to the cluster pool.
+                */
+
+               if (skb)
+                       bcm570xPktFree (pUmDevice->index, skb);
+
+               pUmPacket->skbuff = 0;
+               QQ_PushTail (&pDevice->TxPacketFreeQ.Container, pPacket);
+               pUmDevice->tx_pkt = 1;
+       }
+       if (pUmDevice->tx_full) {
+               if (QQ_GetEntryCnt (&pDevice->TxPacketFreeQ.Container) >=
+                   (QQ_GetSize (&pDevice->TxPacketFreeQ.Container) >> 1))
+                       pUmDevice->tx_full = 0;
+       }
+       return LM_STATUS_SUCCESS;
 }
 
 /*
@@ -1345,16 +1303,12 @@ MM_IndicateTxPackets(PLM_DEVICE_BLOCK pDevice)
  *  Return its length and physical address.
  */
 void MM_MapTxDma
-    (
-    PLM_DEVICE_BLOCK pDevice,
-    struct _LM_PACKET *pPacket,
-    T3_64BIT_HOST_ADDR *paddr,
-    LM_UINT32 *len,
-    int frag)
-{
-    PUM_PACKET pUmPacket = (PUM_PACKET) pPacket;
-    *len = pPacket->PacketSize;
-    MM_SetT3Addr(paddr, (dma_addr_t) pUmPacket->skbuff);
+    (PLM_DEVICE_BLOCK pDevice,
+     struct _LM_PACKET *pPacket,
+     T3_64BIT_HOST_ADDR * paddr, LM_UINT32 * len, int frag) {
+       PUM_PACKET pUmPacket = (PUM_PACKET) pPacket;
+       *len = pPacket->PacketSize;
+       MM_SetT3Addr (paddr, (dma_addr_t) pUmPacket->skbuff);
 }
 
 /*
@@ -1362,35 +1316,31 @@ void MM_MapTxDma
  *  to a physical address as seen from a PCI device.  Store the
  *  result at paddr.
  */
-void MM_MapRxDma(
-                PLM_DEVICE_BLOCK pDevice,
-                struct _LM_PACKET *pPacket,
-                T3_64BIT_HOST_ADDR *paddr)
+void MM_MapRxDma (PLM_DEVICE_BLOCK pDevice,
+                 struct _LM_PACKET *pPacket, T3_64BIT_HOST_ADDR * paddr)
 {
-    PUM_PACKET pUmPacket = (PUM_PACKET) pPacket;
-    MM_SetT3Addr(paddr, (dma_addr_t) pUmPacket->skbuff);
+       PUM_PACKET pUmPacket = (PUM_PACKET) pPacket;
+       MM_SetT3Addr (paddr, (dma_addr_t) pUmPacket->skbuff);
 }
 
-void
-MM_SetAddr (LM_PHYSICAL_ADDRESS *paddr, dma_addr_t addr)
+void MM_SetAddr (LM_PHYSICAL_ADDRESS * paddr, dma_addr_t addr)
 {
 #if (BITS_PER_LONG == 64)
-       paddr->High = ((unsigned long) addr) >> 32;
-       paddr->Low = ((unsigned long) addr) & 0xffffffff;
+       paddr->High = ((unsigned long)addr) >> 32;
+       paddr->Low = ((unsigned long)addr) & 0xffffffff;
 #else
        paddr->High = 0;
-       paddr->Low = (unsigned long) addr;
+       paddr->Low = (unsigned long)addr;
 #endif
 }
 
-void
-MM_SetT3Addr(T3_64BIT_HOST_ADDR *paddr, dma_addr_t addr)
+void MM_SetT3Addr (T3_64BIT_HOST_ADDR * paddr, dma_addr_t addr)
 {
-       unsigned long baddr = (unsigned long) addr;
+       unsigned long baddr = (unsigned long)addr;
 #if (BITS_PER_LONG == 64)
-       set_64bit_addr(paddr, baddr & 0xffffffff, baddr >> 32);
+       set_64bit_addr (paddr, baddr & 0xffffffff, baddr >> 32);
 #else
-       set_64bit_addr(paddr, baddr, 0);
+       set_64bit_addr (paddr, baddr, 0);
 #endif
 }
 
@@ -1403,42 +1353,38 @@ MM_SetT3Addr(T3_64BIT_HOST_ADDR *paddr, dma_addr_t addr)
  * If any uses of the function remain, they will refer to the single copy
  * in the library.
  */
-void
-atomic_set(atomic_t* entry, int val)
+void atomic_set (atomic_t * entry, int val)
 {
-    entry->counter = val;
+       entry->counter = val;
 }
-int
-atomic_read(atomic_t* entry)
+
+int atomic_read (atomic_t * entry)
 {
-    return entry->counter;
+       return entry->counter;
 }
-void
-atomic_inc(atomic_t* entry)
+
+void atomic_inc (atomic_t * entry)
 {
-    if(entry)
-       entry->counter++;
+       if (entry)
+               entry->counter++;
 }
 
-void
-atomic_dec(atomic_t* entry)
+void atomic_dec (atomic_t * entry)
 {
-    if(entry)
-       entry->counter--;
+       if (entry)
+               entry->counter--;
 }
 
-void
-atomic_sub(int a, atomic_t* entry)
+void atomic_sub (int a, atomic_t * entry)
 {
-    if(entry)
-       entry->counter -= a;
+       if (entry)
+               entry->counter -= a;
 }
 
-void
-atomic_add(int a, atomic_t* entry)
+void atomic_add (int a, atomic_t * entry)
 {
-    if(entry)
-       entry->counter += a;
+       if (entry)
+               entry->counter += a;
 }
 
 /******************************************************************************/
@@ -1446,68 +1392,57 @@ atomic_add(int a, atomic_t* entry)
 /*                                                                            */
 /* Return:                                                                    */
 /******************************************************************************/
-void
-QQ_InitQueue(
-PQQ_CONTAINER pQueue,
-unsigned int QueueSize) {
-    pQueue->Head = 0;
-    pQueue->Tail = 0;
-    pQueue->Size = QueueSize+1;
-    atomic_set(&pQueue->EntryCnt, 0);
-} /* QQ_InitQueue */
-
+void QQ_InitQueue (PQQ_CONTAINER pQueue, unsigned int QueueSize)
+{
+       pQueue->Head = 0;
+       pQueue->Tail = 0;
+       pQueue->Size = QueueSize + 1;
+       atomic_set (&pQueue->EntryCnt, 0);
+}                              /* QQ_InitQueue */
 
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
 /* Return:                                                                    */
 /******************************************************************************/
-char
-QQ_Full(
-PQQ_CONTAINER pQueue) {
-    unsigned int NewHead;
-
-    NewHead = (pQueue->Head + 1) % pQueue->Size;
+char QQ_Full (PQQ_CONTAINER pQueue)
+{
+       unsigned int NewHead;
 
-    return(NewHead == pQueue->Tail);
-} /* QQ_Full */
+       NewHead = (pQueue->Head + 1) % pQueue->Size;
 
+       return (NewHead == pQueue->Tail);
+}                              /* QQ_Full */
 
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
 /* Return:                                                                    */
 /******************************************************************************/
-char
-QQ_Empty(
-PQQ_CONTAINER pQueue) {
-    return(pQueue->Head == pQueue->Tail);
-} /* QQ_Empty */
-
+char QQ_Empty (PQQ_CONTAINER pQueue)
+{
+       return (pQueue->Head == pQueue->Tail);
+}                              /* QQ_Empty */
 
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
 /* Return:                                                                    */
 /******************************************************************************/
-unsigned int
-QQ_GetSize(
-PQQ_CONTAINER pQueue) {
-    return pQueue->Size;
-} /* QQ_GetSize */
-
+unsigned int QQ_GetSize (PQQ_CONTAINER pQueue)
+{
+       return pQueue->Size;
+}                              /* QQ_GetSize */
 
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
 /* Return:                                                                    */
 /******************************************************************************/
-unsigned int
-QQ_GetEntryCnt(
-PQQ_CONTAINER pQueue) {
-    return atomic_read(&pQueue->EntryCnt);
-} /* QQ_GetEntryCnt */
-
+unsigned int QQ_GetEntryCnt (PQQ_CONTAINER pQueue)
+{
+       return atomic_read (&pQueue->EntryCnt);
+}                              /* QQ_GetEntryCnt */
 
 /******************************************************************************/
 /* Description:                                                               */
@@ -1516,28 +1451,25 @@ PQQ_CONTAINER pQueue) {
 /*    TRUE entry was added successfully.                                      */
 /*    FALSE queue is full.                                                    */
 /******************************************************************************/
-char
-QQ_PushHead(
-PQQ_CONTAINER pQueue,
-PQQ_ENTRY pEntry) {
-    unsigned int Head;
+char QQ_PushHead (PQQ_CONTAINER pQueue, PQQ_ENTRY pEntry)
+{
+       unsigned int Head;
 
-    Head = (pQueue->Head + 1) % pQueue->Size;
+       Head = (pQueue->Head + 1) % pQueue->Size;
 
 #if !defined(QQ_NO_OVERFLOW_CHECK)
-    if(Head == pQueue->Tail) {
-       return 0;
-    } /* if */
-#endif /* QQ_NO_OVERFLOW_CHECK */
+       if (Head == pQueue->Tail) {
+               return 0;
+       }                       /* if */
+#endif                         /* QQ_NO_OVERFLOW_CHECK */
 
-    pQueue->Array[pQueue->Head] = pEntry;
-    wmb();
-    pQueue->Head = Head;
-    atomic_inc(&pQueue->EntryCnt);
-
-    return -1;
-} /* QQ_PushHead */
+       pQueue->Array[pQueue->Head] = pEntry;
+       wmb ();
+       pQueue->Head = Head;
+       atomic_inc (&pQueue->EntryCnt);
 
+       return -1;
+}                              /* QQ_PushHead */
 
 /******************************************************************************/
 /* Description:                                                               */
@@ -1546,146 +1478,126 @@ PQQ_ENTRY pEntry) {
 /*    TRUE entry was added successfully.                                      */
 /*    FALSE queue is full.                                                    */
 /******************************************************************************/
-char
-QQ_PushTail(
-PQQ_CONTAINER pQueue,
-PQQ_ENTRY pEntry) {
-    unsigned int Tail;
-
-    Tail = pQueue->Tail;
-    if(Tail == 0) {
-       Tail = pQueue->Size;
-    } /* if */
-    Tail--;
+char QQ_PushTail (PQQ_CONTAINER pQueue, PQQ_ENTRY pEntry)
+{
+       unsigned int Tail;
 
-#if !defined(QQ_NO_OVERFLOW_CHECK)
-    if(Tail == pQueue->Head) {
-       return 0;
-    } /* if */
-#endif /* QQ_NO_OVERFLOW_CHECK */
+       Tail = pQueue->Tail;
+       if (Tail == 0) {
+               Tail = pQueue->Size;
+       }                       /* if */
+       Tail--;
 
-    pQueue->Array[Tail] = pEntry;
-    wmb();
-    pQueue->Tail = Tail;
-    atomic_inc(&pQueue->EntryCnt);
+#if !defined(QQ_NO_OVERFLOW_CHECK)
+       if (Tail == pQueue->Head) {
+               return 0;
+       }                       /* if */
+#endif                         /* QQ_NO_OVERFLOW_CHECK */
 
-    return -1;
-} /* QQ_PushTail */
+       pQueue->Array[Tail] = pEntry;
+       wmb ();
+       pQueue->Tail = Tail;
+       atomic_inc (&pQueue->EntryCnt);
 
+       return -1;
+}                              /* QQ_PushTail */
 
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
 /* Return:                                                                    */
 /******************************************************************************/
-PQQ_ENTRY
-QQ_PopHead(
-PQQ_CONTAINER pQueue) {
-    unsigned int Head;
-    PQQ_ENTRY Entry;
+PQQ_ENTRY QQ_PopHead (PQQ_CONTAINER pQueue)
+{
+       unsigned int Head;
+       PQQ_ENTRY Entry;
 
-    Head = pQueue->Head;
+       Head = pQueue->Head;
 
 #if !defined(QQ_NO_UNDERFLOW_CHECK)
-    if(Head == pQueue->Tail) {
-       return (PQQ_ENTRY) 0;
-    } /* if */
-#endif /* QQ_NO_UNDERFLOW_CHECK */
-
-    if(Head == 0) {
-       Head = pQueue->Size;
-    } /* if */
-    Head--;
+       if (Head == pQueue->Tail) {
+               return (PQQ_ENTRY) 0;
+       }                       /* if */
+#endif                         /* QQ_NO_UNDERFLOW_CHECK */
 
-    Entry = pQueue->Array[Head];
-    membar();
+       if (Head == 0) {
+               Head = pQueue->Size;
+       }                       /* if */
+       Head--;
 
-    pQueue->Head = Head;
-    atomic_dec(&pQueue->EntryCnt);
+       Entry = pQueue->Array[Head];
+       membar ();
 
-    return Entry;
-} /* QQ_PopHead */
+       pQueue->Head = Head;
+       atomic_dec (&pQueue->EntryCnt);
 
+       return Entry;
+}                              /* QQ_PopHead */
 
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
 /* Return:                                                                    */
 /******************************************************************************/
-PQQ_ENTRY
-QQ_PopTail(
-PQQ_CONTAINER pQueue) {
-    unsigned int Tail;
-    PQQ_ENTRY Entry;
+PQQ_ENTRY QQ_PopTail (PQQ_CONTAINER pQueue)
+{
+       unsigned int Tail;
+       PQQ_ENTRY Entry;
 
-    Tail = pQueue->Tail;
+       Tail = pQueue->Tail;
 
 #if !defined(QQ_NO_UNDERFLOW_CHECK)
-    if(Tail == pQueue->Head) {
-       return (PQQ_ENTRY) 0;
-    } /* if */
-#endif /* QQ_NO_UNDERFLOW_CHECK */
-
-    Entry = pQueue->Array[Tail];
-    membar();
-    pQueue->Tail = (Tail + 1) % pQueue->Size;
-    atomic_dec(&pQueue->EntryCnt);
+       if (Tail == pQueue->Head) {
+               return (PQQ_ENTRY) 0;
+       }                       /* if */
+#endif                         /* QQ_NO_UNDERFLOW_CHECK */
 
-    return Entry;
-} /* QQ_PopTail */
+       Entry = pQueue->Array[Tail];
+       membar ();
+       pQueue->Tail = (Tail + 1) % pQueue->Size;
+       atomic_dec (&pQueue->EntryCnt);
 
+       return Entry;
+}                              /* QQ_PopTail */
 
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
 /* Return:                                                                    */
 /******************************************************************************/
-PQQ_ENTRY
-QQ_GetHead(
-    PQQ_CONTAINER pQueue,
-    unsigned int Idx)
+PQQ_ENTRY QQ_GetHead (PQQ_CONTAINER pQueue, unsigned int Idx)
 {
-    if(Idx >= atomic_read(&pQueue->EntryCnt))
-    {
-       return (PQQ_ENTRY) 0;
-    }
-
-    if(pQueue->Head > Idx)
-    {
-       Idx = pQueue->Head - Idx;
-    }
-    else
-    {
-       Idx = pQueue->Size - (Idx - pQueue->Head);
-    }
-    Idx--;
-
-    return pQueue->Array[Idx];
-}
+       if (Idx >= atomic_read (&pQueue->EntryCnt)) {
+               return (PQQ_ENTRY) 0;
+       }
+
+       if (pQueue->Head > Idx) {
+               Idx = pQueue->Head - Idx;
+       } else {
+               Idx = pQueue->Size - (Idx - pQueue->Head);
+       }
+       Idx--;
 
+       return pQueue->Array[Idx];
+}
 
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
 /* Return:                                                                    */
 /******************************************************************************/
-PQQ_ENTRY
-QQ_GetTail(
-    PQQ_CONTAINER pQueue,
-    unsigned int Idx)
+PQQ_ENTRY QQ_GetTail (PQQ_CONTAINER pQueue, unsigned int Idx)
 {
-    if(Idx >= atomic_read(&pQueue->EntryCnt))
-    {
-       return (PQQ_ENTRY) 0;
-    }
-
-    Idx += pQueue->Tail;
-    if(Idx >= pQueue->Size)
-    {
-       Idx = Idx - pQueue->Size;
-    }
-
-    return pQueue->Array[Idx];
+       if (Idx >= atomic_read (&pQueue->EntryCnt)) {
+               return (PQQ_ENTRY) 0;
+       }
+
+       Idx += pQueue->Tail;
+       if (Idx >= pQueue->Size) {
+               Idx = Idx - pQueue->Size;
+       }
+
+       return pQueue->Array[Idx];
 }
 
-#endif /* CFG_CMD_NET, !CONFIG_NET_MULTI, CONFIG_BCM570x */
+#endif                         /* CFG_CMD_NET, !CONFIG_NET_MULTI, CONFIG_BCM570x */
index 607f3fd..2ea6ca8 100644 (file)
 #include "bcm570x_queue.h"
 #include "bcm570x_bits.h"
 
-
 /******************************************************************************/
 /* Basic types. */
 /******************************************************************************/
 
-typedef char           LM_CHAR,    *PLM_CHAR;
-typedef unsigned int   LM_UINT,    *PLM_UINT;
-typedef unsigned char  LM_UINT8,   *PLM_UINT8;
-typedef unsigned short LM_UINT16,  *PLM_UINT16;
-typedef unsigned int   LM_UINT32,  *PLM_UINT32;
-typedef unsigned int   LM_COUNTER, *PLM_COUNTER;
-typedef void           LM_VOID,    *PLM_VOID;
-typedef char           LM_BOOL,    *PLM_BOOL;
+typedef char LM_CHAR, *PLM_CHAR;
+typedef unsigned int LM_UINT, *PLM_UINT;
+typedef unsigned char LM_UINT8, *PLM_UINT8;
+typedef unsigned short LM_UINT16, *PLM_UINT16;
+typedef unsigned int LM_UINT32, *PLM_UINT32;
+typedef unsigned int LM_COUNTER, *PLM_COUNTER;
+typedef void LM_VOID, *PLM_VOID;
+typedef char LM_BOOL, *PLM_BOOL;
 
 /* 64bit value. */
 typedef struct {
 #ifdef BIG_ENDIAN_HOST
-    LM_UINT32 High;
-    LM_UINT32 Low;
-#else /* BIG_ENDIAN_HOST */
-    LM_UINT32 Low;
-    LM_UINT32 High;
-#endif /* !BIG_ENDIAN_HOST */
+       LM_UINT32 High;
+       LM_UINT32 Low;
+#else                          /* BIG_ENDIAN_HOST */
+       LM_UINT32 Low;
+       LM_UINT32 High;
+#endif                         /* !BIG_ENDIAN_HOST */
 } LM_UINT64, *PLM_UINT64;
 
 typedef LM_UINT64 LM_PHYSICAL_ADDRESS, *PLM_PHYSICAL_ADDRESS;
@@ -58,15 +57,13 @@ typedef LM_UINT64 LM_PHYSICAL_ADDRESS, *PLM_PHYSICAL_ADDRESS;
        }                                                   \
     }
 
-
 #ifndef NULL
 #define NULL                ((void *) 0)
-#endif /* NULL */
+#endif                         /* NULL */
 
 #ifndef OFFSETOF
 #define OFFSETOF(_s, _m)    (MM_UINT_PTR(&(((_s *) 0)->_m)))
-#endif /* OFFSETOF */
-
+#endif                         /* OFFSETOF */
 
 /******************************************************************************/
 /* Simple macros. */
@@ -100,26 +97,24 @@ typedef LM_UINT64 LM_PHYSICAL_ADDRESS, *PLM_PHYSICAL_ADDRESS;
     ((unsigned char *) (_Dst))[4] = ((unsigned char *) (_Src))[4];          \
     ((unsigned char *) (_Dst))[5] = ((unsigned char *) (_Src))[5];
 
-
 /******************************************************************************/
 /* Constants. */
 /******************************************************************************/
 
 #define ETHERNET_ADDRESS_SIZE           6
 #define ETHERNET_PACKET_HEADER_SIZE     14
-#define MIN_ETHERNET_PACKET_SIZE        64      /* with 4 byte crc. */
-#define MAX_ETHERNET_PACKET_SIZE        1518    /* with 4 byte crc. */
+#define MIN_ETHERNET_PACKET_SIZE        64     /* with 4 byte crc. */
+#define MAX_ETHERNET_PACKET_SIZE        1518   /* with 4 byte crc. */
 #define MIN_ETHERNET_PACKET_SIZE_NO_CRC 60
 #define MAX_ETHERNET_PACKET_SIZE_NO_CRC 1514
-#define MAX_ETHERNET_PACKET_BUFFER_SIZE 1536    /* A nice even number. */
+#define MAX_ETHERNET_PACKET_BUFFER_SIZE 1536   /* A nice even number. */
 
 #ifndef LM_MAX_MC_TABLE_SIZE
 #define LM_MAX_MC_TABLE_SIZE            32
-#endif /* LM_MAX_MC_TABLE_SIZE */
+#endif                         /* LM_MAX_MC_TABLE_SIZE */
 #define LM_MC_ENTRY_SIZE                (ETHERNET_ADDRESS_SIZE+1)
 #define LM_MC_INSTANCE_COUNT_INDEX      (LM_MC_ENTRY_SIZE-1)
 
-
 /* Receive filter masks. */
 #define LM_ACCEPT_UNICAST               0x0001
 #define LM_ACCEPT_MULTICAST             0x0002
@@ -129,7 +124,6 @@ typedef LM_UINT64 LM_PHYSICAL_ADDRESS, *PLM_PHYSICAL_ADDRESS;
 
 #define LM_PROMISCUOUS_MODE             0x10000
 
-
 /******************************************************************************/
 /* PCI registers. */
 /******************************************************************************/
@@ -169,20 +163,20 @@ typedef LM_UINT64 LM_PHYSICAL_ADDRESS, *PLM_PHYSICAL_ADDRESS;
 /******************************************************************************/
 
 typedef struct {
-    LM_UINT32 FragSize;
-    LM_PHYSICAL_ADDRESS FragBuf;
+       LM_UINT32 FragSize;
+       LM_PHYSICAL_ADDRESS FragBuf;
 } LM_FRAG, *PLM_FRAG;
 
 typedef struct {
-    /* FragCount is initialized for the caller to the maximum array size, on */
-    /* return FragCount is the number of the actual fragments in the array. */
-    LM_UINT32 FragCount;
+       /* FragCount is initialized for the caller to the maximum array size, on */
+       /* return FragCount is the number of the actual fragments in the array. */
+       LM_UINT32 FragCount;
 
-    /* Total buffer size. */
-    LM_UINT32 TotalSize;
+       /* Total buffer size. */
+       LM_UINT32 TotalSize;
 
-    /* Fragment array buffer. */
-    LM_FRAG Fragments[1];
+       /* Fragment array buffer. */
+       LM_FRAG Fragments[1];
 } LM_FRAG_LIST, *PLM_FRAG_LIST;
 
 #define DECLARE_FRAG_LIST_BUFFER_TYPE(_FRAG_LIST_TYPE_NAME, _MAX_FRAG_COUNT) \
@@ -191,7 +185,6 @@ typedef struct {
        LM_FRAG FragListBuffer[_MAX_FRAG_COUNT-1];                           \
     } _FRAG_LIST_TYPE_NAME, *P##_FRAG_LIST_TYPE_NAME
 
-
 /******************************************************************************/
 /* Status codes. */
 /******************************************************************************/
@@ -217,7 +210,6 @@ typedef struct {
 
 typedef LM_UINT LM_STATUS, *PLM_STATUS;
 
-
 /******************************************************************************/
 /* Requested media type. */
 /******************************************************************************/
@@ -240,7 +232,6 @@ typedef LM_UINT LM_STATUS, *PLM_STATUS;
 
 typedef LM_UINT32 LM_REQUESTED_MEDIA_TYPE, *PLM_REQUESTED_MEDIA_TYPE;
 
-
 /******************************************************************************/
 /* Media type. */
 /******************************************************************************/
@@ -254,7 +245,6 @@ typedef LM_UINT32 LM_REQUESTED_MEDIA_TYPE, *PLM_REQUESTED_MEDIA_TYPE;
 
 typedef LM_UINT32 LM_MEDIA_TYPE, *PLM_MEDIA_TYPE;
 
-
 /******************************************************************************/
 /* Line speed. */
 /******************************************************************************/
@@ -266,7 +256,6 @@ typedef LM_UINT32 LM_MEDIA_TYPE, *PLM_MEDIA_TYPE;
 
 typedef LM_UINT32 LM_LINE_SPEED, *PLM_LINE_SPEED;
 
-
 /******************************************************************************/
 /* Duplex mode. */
 /******************************************************************************/
@@ -277,7 +266,6 @@ typedef LM_UINT32 LM_LINE_SPEED, *PLM_LINE_SPEED;
 
 typedef LM_UINT32 LM_DUPLEX_MODE, *PLM_DUPLEX_MODE;
 
-
 /******************************************************************************/
 /* Power state. */
 /******************************************************************************/
@@ -289,7 +277,6 @@ typedef LM_UINT32 LM_DUPLEX_MODE, *PLM_DUPLEX_MODE;
 
 typedef LM_UINT32 LM_POWER_STATE, *PLM_POWER_STATE;
 
-
 /******************************************************************************/
 /* Task offloading. */
 /******************************************************************************/
@@ -305,7 +292,6 @@ typedef LM_UINT32 LM_POWER_STATE, *PLM_POWER_STATE;
 
 typedef LM_UINT32 LM_TASK_OFFLOAD, *PLM_TASK_OFFLOAD;
 
-
 /******************************************************************************/
 /* Flow control. */
 /******************************************************************************/
@@ -324,7 +310,6 @@ typedef LM_UINT32 LM_TASK_OFFLOAD, *PLM_TASK_OFFLOAD;
 
 typedef LM_UINT32 LM_FLOW_CONTROL, *PLM_FLOW_CONTROL;
 
-
 /******************************************************************************/
 /* Wake up mode. */
 /******************************************************************************/
@@ -336,7 +321,6 @@ typedef LM_UINT32 LM_FLOW_CONTROL, *PLM_FLOW_CONTROL;
 
 typedef LM_UINT32 LM_WAKE_UP_MODE, *PLM_WAKE_UP_MODE;
 
-
 /******************************************************************************/
 /* Counters. */
 /******************************************************************************/
@@ -362,7 +346,6 @@ typedef LM_UINT32 LM_WAKE_UP_MODE, *PLM_WAKE_UP_MODE;
 
 typedef LM_UINT32 LM_COUNTER_TYPE, *PLM_COUNTER_TYPE;
 
-
 /******************************************************************************/
 /* Forward definition. */
 /******************************************************************************/
@@ -370,82 +353,82 @@ typedef LM_UINT32 LM_COUNTER_TYPE, *PLM_COUNTER_TYPE;
 typedef struct _LM_DEVICE_BLOCK *PLM_DEVICE_BLOCK;
 typedef struct _LM_PACKET *PLM_PACKET;
 
-
 /******************************************************************************/
 /* Function prototypes. */
 /******************************************************************************/
 
-LM_STATUS LM_GetAdapterInfo(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS LM_InitializeAdapter(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS LM_ResetAdapter(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS LM_DisableInterrupt(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS LM_EnableInterrupt(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS LM_SendPacket(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket);
-LM_STATUS LM_ServiceInterrupts(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS LM_QueueRxPackets(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS LM_SetReceiveMask(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Mask);
-LM_STATUS LM_Halt(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS LM_Abort(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS LM_MulticastAdd(PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pMcAddress);
-LM_STATUS LM_MulticastDel(PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pMcAddress);
-LM_STATUS LM_MulticastClear(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS LM_SetMacAddress(PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pMacAddress);
-LM_STATUS LM_LoopbackAddress(PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pAddress);
-
-LM_UINT32 LM_GetCrcCounter(PLM_DEVICE_BLOCK pDevice);
-
-LM_WAKE_UP_MODE LM_PMCapabilities(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS LM_NwufAdd(PLM_DEVICE_BLOCK pDevice, LM_UINT32 ByteMaskSize,
-    LM_UINT8 *pByteMask, LM_UINT8 *pPattern);
-LM_STATUS LM_NwufRemove(PLM_DEVICE_BLOCK pDevice, LM_UINT32 ByteMaskSize,
-    LM_UINT8 *pByteMask, LM_UINT8 *pPattern);
-LM_STATUS LM_SetPowerState(PLM_DEVICE_BLOCK pDevice, LM_POWER_STATE PowerLevel);
-
-LM_VOID LM_ReadPhy(PLM_DEVICE_BLOCK pDevice, LM_UINT32 PhyReg,
-    PLM_UINT32 pData32);
-LM_VOID LM_WritePhy(PLM_DEVICE_BLOCK pDevice, LM_UINT32 PhyReg,
-    LM_UINT32 Data32);
-
-LM_STATUS LM_ControlLoopBack(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Control);
-LM_STATUS LM_SetupPhy(PLM_DEVICE_BLOCK pDevice);
-int LM_BlinkLED(PLM_DEVICE_BLOCK pDevice, LM_UINT32 BlinkDuration);
-
+LM_STATUS LM_GetAdapterInfo (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS LM_InitializeAdapter (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS LM_ResetAdapter (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS LM_DisableInterrupt (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS LM_EnableInterrupt (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS LM_SendPacket (PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket);
+LM_STATUS LM_ServiceInterrupts (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS LM_QueueRxPackets (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS LM_SetReceiveMask (PLM_DEVICE_BLOCK pDevice, LM_UINT32 Mask);
+LM_STATUS LM_Halt (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS LM_Abort (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS LM_MulticastAdd (PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pMcAddress);
+LM_STATUS LM_MulticastDel (PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pMcAddress);
+LM_STATUS LM_MulticastClear (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS LM_SetMacAddress (PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pMacAddress);
+LM_STATUS LM_LoopbackAddress (PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pAddress);
+
+LM_UINT32 LM_GetCrcCounter (PLM_DEVICE_BLOCK pDevice);
+
+LM_WAKE_UP_MODE LM_PMCapabilities (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS LM_NwufAdd (PLM_DEVICE_BLOCK pDevice, LM_UINT32 ByteMaskSize,
+                     LM_UINT8 * pByteMask, LM_UINT8 * pPattern);
+LM_STATUS LM_NwufRemove (PLM_DEVICE_BLOCK pDevice, LM_UINT32 ByteMaskSize,
+                        LM_UINT8 * pByteMask, LM_UINT8 * pPattern);
+LM_STATUS LM_SetPowerState (PLM_DEVICE_BLOCK pDevice,
+                           LM_POWER_STATE PowerLevel);
+
+LM_VOID LM_ReadPhy (PLM_DEVICE_BLOCK pDevice, LM_UINT32 PhyReg,
+                   PLM_UINT32 pData32);
+LM_VOID LM_WritePhy (PLM_DEVICE_BLOCK pDevice, LM_UINT32 PhyReg,
+                    LM_UINT32 Data32);
+
+LM_STATUS LM_ControlLoopBack (PLM_DEVICE_BLOCK pDevice, LM_UINT32 Control);
+LM_STATUS LM_SetupPhy (PLM_DEVICE_BLOCK pDevice);
+int LM_BlinkLED (PLM_DEVICE_BLOCK pDevice, LM_UINT32 BlinkDuration);
 
 /******************************************************************************/
 /* These are the OS specific functions called by LMAC. */
 /******************************************************************************/
 
-LM_STATUS MM_ReadConfig16(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset,
-    LM_UINT16 *pValue16);
-LM_STATUS MM_WriteConfig16(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset,
-    LM_UINT16 Value16);
-LM_STATUS MM_ReadConfig32(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset,
-    LM_UINT32 *pValue32);
-LM_STATUS MM_WriteConfig32(PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset,
-    LM_UINT32 Value32);
-LM_STATUS MM_MapMemBase(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS MM_MapIoBase(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS MM_IndicateRxPackets(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS MM_IndicateTxPackets(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS MM_StartTxDma(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket);
-LM_STATUS MM_CompleteTxDma(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket);
-LM_STATUS MM_AllocateMemory(PLM_DEVICE_BLOCK pDevice, LM_UINT32 BlockSize,
-    PLM_VOID *pMemoryBlockVirt);
-LM_STATUS MM_AllocateSharedMemory(PLM_DEVICE_BLOCK pDevice, LM_UINT32 BlockSize,
-    PLM_VOID *pMemoryBlockVirt, PLM_PHYSICAL_ADDRESS pMemoryBlockPhy,
-    LM_BOOL Cached);
-LM_STATUS MM_GetConfig(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS MM_IndicateStatus(PLM_DEVICE_BLOCK pDevice, LM_STATUS Status);
-LM_STATUS MM_InitializeUmPackets(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS MM_FreeRxBuffer(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket);
-LM_STATUS MM_CoalesceTxBuffer(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket);
-LM_STATUS LM_MbufWorkAround(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS LM_SetLinkSpeed(PLM_DEVICE_BLOCK pDevice,
-                         LM_REQUESTED_MEDIA_TYPE RequestedMediaType);
+LM_STATUS MM_ReadConfig16 (PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset,
+                          LM_UINT16 * pValue16);
+LM_STATUS MM_WriteConfig16 (PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset,
+                           LM_UINT16 Value16);
+LM_STATUS MM_ReadConfig32 (PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset,
+                          LM_UINT32 * pValue32);
+LM_STATUS MM_WriteConfig32 (PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset,
+                           LM_UINT32 Value32);
+LM_STATUS MM_MapMemBase (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS MM_MapIoBase (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS MM_IndicateRxPackets (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS MM_IndicateTxPackets (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS MM_StartTxDma (PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket);
+LM_STATUS MM_CompleteTxDma (PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket);
+LM_STATUS MM_AllocateMemory (PLM_DEVICE_BLOCK pDevice, LM_UINT32 BlockSize,
+                            PLM_VOID * pMemoryBlockVirt);
+LM_STATUS MM_AllocateSharedMemory (PLM_DEVICE_BLOCK pDevice,
+                                  LM_UINT32 BlockSize,
+                                  PLM_VOID * pMemoryBlockVirt,
+                                  PLM_PHYSICAL_ADDRESS pMemoryBlockPhy,
+                                  LM_BOOL Cached);
+LM_STATUS MM_GetConfig (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS MM_IndicateStatus (PLM_DEVICE_BLOCK pDevice, LM_STATUS Status);
+LM_STATUS MM_InitializeUmPackets (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS MM_FreeRxBuffer (PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket);
+LM_STATUS MM_CoalesceTxBuffer (PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket);
+LM_STATUS LM_MbufWorkAround (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS LM_SetLinkSpeed (PLM_DEVICE_BLOCK pDevice,
+                          LM_REQUESTED_MEDIA_TYPE RequestedMediaType);
 
 #if INCLUDE_5703_A0_FIX
-LM_STATUS LM_Load5703DmaWFirmware(PLM_DEVICE_BLOCK pDevice);
+LM_STATUS LM_Load5703DmaWFirmware (PLM_DEVICE_BLOCK pDevice);
 #endif
 
-
-#endif /* LM_H */
+#endif                         /* LM_H */
index b7cbf8a..ff5302f 100644 (file)
@@ -45,7 +45,7 @@ extern int MM_Packet_Desc_Size;
 
 #define MM_PACKET_DESC_SIZE MM_Packet_Desc_Size
 
-DECLARE_QUEUE_TYPE(UM_RX_PACKET_Q, MAX_RX_PACKET_DESC_COUNT+1);
+DECLARE_QUEUE_TYPE (UM_RX_PACKET_Q, MAX_RX_PACKET_DESC_COUNT + 1);
 
 #define MAX_MEM 16
 
@@ -65,51 +65,50 @@ typedef struct _UM_DEVICE_BLOCK {
        int mtu;
        int index;
        int opened;
-       int delayed_link_ind; /* Delay link status during initial load */
-       int adapter_just_inited; /* the first few seconds after init. */
-       int spurious_int;            /* new -- unsupported */
+       int delayed_link_ind;   /* Delay link status during initial load */
+       int adapter_just_inited;        /* the first few seconds after init. */
+       int spurious_int;       /* new -- unsupported */
        int timer_interval;
        int adaptive_expiry;
-       int crc_counter_expiry;         /* new -- unsupported */
-       int poll_tib_expiry;         /* new -- unsupported */
+       int crc_counter_expiry; /* new -- unsupported */
+       int poll_tib_expiry;    /* new -- unsupported */
        int tx_full;
        int tx_queued;
        int line_speed;         /* in Mbps, 0 if link is down */
        UM_RX_PACKET_Q rx_out_of_buf_q;
        int rx_out_of_buf;
-       int rx_low_buf_thresh; /* changed to rx_buf_repl_thresh */
+       int rx_low_buf_thresh;  /* changed to rx_buf_repl_thresh */
        int rx_buf_repl_panic_thresh;
-       int rx_buf_align;            /* new -- unsupported */
+       int rx_buf_align;       /* new -- unsupported */
        int do_global_lock;
        mutex_t global_lock;
        mutex_t undi_lock;
        long undi_flags;
        volatile int interrupt;
        int tasklet_pending;
-       int tasklet_busy;            /* new -- unsupported */
+       int tasklet_busy;       /* new -- unsupported */
        int rx_pkt;
        int tx_pkt;
-#ifdef NICE_SUPPORT   /* unsupported, this is a linux ioctl */
-       void (*nice_rx)(void*, void* );
-       voidnice_ctx;
-#endif /* NICE_SUPPORT */
+#ifdef NICE_SUPPORT            /* unsupported, this is a linux ioctl */
+       void (*nice_rx) (void *, void *);
+       void *nice_ctx;
+#endif                         /* NICE_SUPPORT */
        int rx_adaptive_coalesce;
        unsigned int rx_last_cnt;
        unsigned int tx_last_cnt;
        unsigned int rx_curr_coalesce_frames;
        unsigned int rx_curr_coalesce_ticks;
-       unsigned int tx_curr_coalesce_frames;  /* new -- unsupported */
-#if TIGON3_DEBUG          /* new -- unsupported */
+       unsigned int tx_curr_coalesce_frames;   /* new -- unsupported */
+#if TIGON3_DEBUG               /* new -- unsupported */
        uint tx_zc_count;
        uint tx_chksum_count;
        uint tx_himem_count;
        uint rx_good_chksum_count;
 #endif
-       unsigned int rx_bad_chksum_count;   /* new -- unsupported */
-       unsigned int rx_misc_errors;        /* new -- unsupported */
+       unsigned int rx_bad_chksum_count;       /* new -- unsupported */
+       unsigned int rx_misc_errors;    /* new -- unsupported */
 } UM_DEVICE_BLOCK, *PUM_DEVICE_BLOCK;
 
-
 /* Physical/PCI DMA address */
 typedef union {
        dma_addr_t dma_map;
@@ -117,9 +116,9 @@ typedef union {
 
 /* Packet */
 typedef struct
-_UM_PACKET {
-    LM_PACKET lm_packet;
-    void* skbuff;      /* Address of packet buffer */
+    _UM_PACKET {
+       LM_PACKET lm_packet;
+       void *skbuff;           /* Address of packet buffer */
 } UM_PACKET, *PUM_PACKET;
 
 #define MM_ACQUIRE_UNDI_LOCK(_pDevice)
@@ -137,15 +136,14 @@ _UM_PACKET {
 
 #define MEM_TO_PCI_PHYS(addr) (addr)
 
-extern void MM_SetAddr (LM_PHYSICAL_ADDRESS *paddr, dma_addr_t addr);
-extern void MM_SetT3Addr(T3_64BIT_HOST_ADDR *paddr, dma_addr_t addr);
+extern void MM_SetAddr (LM_PHYSICAL_ADDRESS * paddr, dma_addr_t addr);
+extern void MM_SetT3Addr (T3_64BIT_HOST_ADDR * paddr, dma_addr_t addr);
 extern void MM_MapTxDma (PLM_DEVICE_BLOCK pDevice,
-                        struct _LM_PACKET *pPacket, T3_64BIT_HOST_ADDR *paddr,
-                        LM_UINT32 *len, int frag);
-extern void MM_MapRxDma ( PLM_DEVICE_BLOCK pDevice,
-                         struct _LM_PACKET *pPacket,
-                         T3_64BIT_HOST_ADDR *paddr);
-
+                        struct _LM_PACKET *pPacket, T3_64BIT_HOST_ADDR * paddr,
+                        LM_UINT32 * len, int frag);
+extern void MM_MapRxDma (PLM_DEVICE_BLOCK pDevice,
+                        struct _LM_PACKET *pPacket,
+                        T3_64BIT_HOST_ADDR * paddr);
 
 /* BSP needs to provide sysUsecDelay and sysSerialPrintString */
 extern void sysSerialPrintString (char *s);
@@ -157,4 +155,4 @@ extern void sysSerialPrintString (char *s);
 #if 0
 #define cpu_to_le32(val) LONGSWAP(val)
 #endif
-#endif /* MM_H */
+#endif                         /* MM_H */
index ec2cd2a..91e22eb 100644 (file)
 /* Local functions. */
 /******************************************************************************/
 
-LM_STATUS LM_Abort(PLM_DEVICE_BLOCK pDevice);
-LM_STATUS LM_QueueRxPackets(PLM_DEVICE_BLOCK pDevice);
-
-static LM_STATUS LM_TranslateRequestedMediaType(
-    LM_REQUESTED_MEDIA_TYPE RequestedMediaType,
-    PLM_MEDIA_TYPE pMediaType, PLM_LINE_SPEED pLineSpeed,
-    PLM_DUPLEX_MODE pDuplexMode);
-
-static LM_STATUS LM_InitBcm540xPhy(PLM_DEVICE_BLOCK pDevice);
-
-__inline static LM_VOID LM_ServiceRxInterrupt(PLM_DEVICE_BLOCK pDevice);
-__inline static LM_VOID LM_ServiceTxInterrupt(PLM_DEVICE_BLOCK pDevice);
-
-static LM_STATUS LM_ForceAutoNegBcm540xPhy(PLM_DEVICE_BLOCK pDevice,
-    LM_REQUESTED_MEDIA_TYPE RequestedMediaType);
-static LM_STATUS LM_ForceAutoNeg(PLM_DEVICE_BLOCK pDevice,
-    LM_REQUESTED_MEDIA_TYPE RequestedMediaType);
-static LM_UINT32 GetPhyAdFlowCntrlSettings(PLM_DEVICE_BLOCK pDevice);
-STATIC LM_STATUS LM_SetFlowControl(PLM_DEVICE_BLOCK pDevice,
-    LM_UINT32 LocalPhyAd, LM_UINT32 RemotePhyAd);
+LM_STATUS LM_Abort (PLM_DEVICE_BLOCK pDevice);
+LM_STATUS LM_QueueRxPackets (PLM_DEVICE_BLOCK pDevice);
+
+static LM_STATUS LM_TranslateRequestedMediaType (LM_REQUESTED_MEDIA_TYPE
+                                                RequestedMediaType,
+                                                PLM_MEDIA_TYPE pMediaType,
+                                                PLM_LINE_SPEED pLineSpeed,
+                                                PLM_DUPLEX_MODE pDuplexMode);
+
+static LM_STATUS LM_InitBcm540xPhy (PLM_DEVICE_BLOCK pDevice);
+
+__inline static LM_VOID LM_ServiceRxInterrupt (PLM_DEVICE_BLOCK pDevice);
+__inline static LM_VOID LM_ServiceTxInterrupt (PLM_DEVICE_BLOCK pDevice);
+
+static LM_STATUS LM_ForceAutoNegBcm540xPhy (PLM_DEVICE_BLOCK pDevice,
+                                           LM_REQUESTED_MEDIA_TYPE
+                                           RequestedMediaType);
+static LM_STATUS LM_ForceAutoNeg (PLM_DEVICE_BLOCK pDevice,
+                                 LM_REQUESTED_MEDIA_TYPE RequestedMediaType);
+static LM_UINT32 GetPhyAdFlowCntrlSettings (PLM_DEVICE_BLOCK pDevice);
+STATIC LM_STATUS LM_SetFlowControl (PLM_DEVICE_BLOCK pDevice,
+                                   LM_UINT32 LocalPhyAd,
+                                   LM_UINT32 RemotePhyAd);
 #if INCLUDE_TBI_SUPPORT
-STATIC LM_STATUS LM_SetupFiberPhy(PLM_DEVICE_BLOCK pDevice);
-STATIC LM_STATUS LM_InitBcm800xPhy(PLM_DEVICE_BLOCK pDevice);
+STATIC LM_STATUS LM_SetupFiberPhy (PLM_DEVICE_BLOCK pDevice);
+STATIC LM_STATUS LM_InitBcm800xPhy (PLM_DEVICE_BLOCK pDevice);
 #endif
-STATIC LM_STATUS LM_SetupCopperPhy(PLM_DEVICE_BLOCK pDevice);
-STATIC PLM_ADAPTER_INFO LM_GetAdapterInfoBySsid(LM_UINT16 Svid, LM_UINT16 Ssid);
-STATIC LM_STATUS LM_DmaTest(PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pBufferVirt,
-          LM_PHYSICAL_ADDRESS BufferPhy, LM_UINT32 BufferSize);
-STATIC LM_STATUS LM_HaltCpu(PLM_DEVICE_BLOCK pDevice,LM_UINT32 cpu_number);
-STATIC LM_STATUS LM_ResetChip(PLM_DEVICE_BLOCK pDevice);
-STATIC LM_STATUS LM_Test4GBoundary(PLM_DEVICE_BLOCK pDevice, PLM_PACKET pPacket,
-    PT3_SND_BD pSendBd);
+STATIC LM_STATUS LM_SetupCopperPhy (PLM_DEVICE_BLOCK pDevice);
+STATIC PLM_ADAPTER_INFO LM_GetAdapterInfoBySsid (LM_UINT16 Svid,
+                                                LM_UINT16 Ssid);
+STATIC LM_STATUS LM_DmaTest (PLM_DEVICE_BLOCK pDevice, PLM_UINT8 pBufferVirt,
+                            LM_PHYSICAL_ADDRESS BufferPhy,
+                            LM_UINT32 BufferSize);
+STATIC LM_STATUS LM_HaltCpu (PLM_DEVICE_BLOCK pDevice, LM_UINT32 cpu_number);
+STATIC LM_STATUS LM_ResetChip (PLM_DEVICE_BLOCK pDevice);
+STATIC LM_STATUS LM_Test4GBoundary (PLM_DEVICE_BLOCK pDevice,
+                                   PLM_PACKET pPacket, PT3_SND_BD pSendBd);
 
 /******************************************************************************/
 /* External functions. */
 /******************************************************************************/
 
-LM_STATUS LM_LoadRlsFirmware(PLM_DEVICE_BLOCK pDevice);
-
+LM_STATUS LM_LoadRlsFirmware (PLM_DEVICE_BLOCK pDevice);
 
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
 /* Return:                                                                    */
 /******************************************************************************/
-LM_UINT32
-LM_RegRdInd(
-PLM_DEVICE_BLOCK pDevice,
-LM_UINT32 Register) {
-    LM_UINT32 Value32;
+LM_UINT32 LM_RegRdInd (PLM_DEVICE_BLOCK pDevice, LM_UINT32 Register)
+{
+       LM_UINT32 Value32;
 
 #if PCIX_TARGET_WORKAROUND
-    MM_ACQUIRE_UNDI_LOCK(pDevice);
+       MM_ACQUIRE_UNDI_LOCK (pDevice);
 #endif
-    MM_WriteConfig32(pDevice, T3_PCI_REG_ADDR_REG, Register);
-    MM_ReadConfig32(pDevice, T3_PCI_REG_DATA_REG, &Value32);
+       MM_WriteConfig32 (pDevice, T3_PCI_REG_ADDR_REG, Register);
+       MM_ReadConfig32 (pDevice, T3_PCI_REG_DATA_REG, &Value32);
 #if PCIX_TARGET_WORKAROUND
-    MM_RELEASE_UNDI_LOCK(pDevice);
+       MM_RELEASE_UNDI_LOCK (pDevice);
 #endif
 
-    return Value32;
-} /* LM_RegRdInd */
-
+       return Value32;
+}                              /* LM_RegRdInd */
 
 /******************************************************************************/
 /* Description:                                                               */
@@ -96,47 +97,41 @@ LM_UINT32 Register) {
 /* Return:                                                                    */
 /******************************************************************************/
 LM_VOID
-LM_RegWrInd(
-PLM_DEVICE_BLOCK pDevice,
-LM_UINT32 Register,
-LM_UINT32 Value32) {
+LM_RegWrInd (PLM_DEVICE_BLOCK pDevice, LM_UINT32 Register, LM_UINT32 Value32)
+{
 
 #if PCIX_TARGET_WORKAROUND
-    MM_ACQUIRE_UNDI_LOCK(pDevice);
+       MM_ACQUIRE_UNDI_LOCK (pDevice);
 #endif
-    MM_WriteConfig32(pDevice, T3_PCI_REG_ADDR_REG, Register);
-    MM_WriteConfig32(pDevice, T3_PCI_REG_DATA_REG, Value32);
+       MM_WriteConfig32 (pDevice, T3_PCI_REG_ADDR_REG, Register);
+       MM_WriteConfig32 (pDevice, T3_PCI_REG_DATA_REG, Value32);
 #if PCIX_TARGET_WORKAROUND
-    MM_RELEASE_UNDI_LOCK(pDevice);
+       MM_RELEASE_UNDI_LOCK (pDevice);
 #endif
-} /* LM_RegWrInd */
-
+}                              /* LM_RegWrInd */
 
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
 /* Return:                                                                    */
 /******************************************************************************/
-LM_UINT32
-LM_MemRdInd(
-PLM_DEVICE_BLOCK pDevice,
-LM_UINT32 MemAddr) {
-    LM_UINT32 Value32;
+LM_UINT32 LM_MemRdInd (PLM_DEVICE_BLOCK pDevice, LM_UINT32 MemAddr)
+{
+       LM_UINT32 Value32;
 
-    MM_ACQUIRE_UNDI_LOCK(pDevice);
+       MM_ACQUIRE_UNDI_LOCK (pDevice);
 #ifdef BIG_ENDIAN_HOST
-    MM_WriteConfig32(pDevice, T3_PCI_MEM_WIN_ADDR_REG, MemAddr);
-    Value32 = REG_RD(pDevice, PciCfg.MemWindowData);
-    /*    Value32 = REG_RD(pDevice,uIntMem.Mbuf[(MemAddr & 0x7fff)/4]); */
+       MM_WriteConfig32 (pDevice, T3_PCI_MEM_WIN_ADDR_REG, MemAddr);
+       Value32 = REG_RD (pDevice, PciCfg.MemWindowData);
+       /*    Value32 = REG_RD(pDevice,uIntMem.Mbuf[(MemAddr & 0x7fff)/4]); */
 #else
-    MM_WriteConfig32(pDevice, T3_PCI_MEM_WIN_ADDR_REG, MemAddr);
-    MM_ReadConfig32(pDevice, T3_PCI_MEM_WIN_DATA_REG, &Value32);
+       MM_WriteConfig32 (pDevice, T3_PCI_MEM_WIN_ADDR_REG, MemAddr);
+       MM_ReadConfig32 (pDevice, T3_PCI_MEM_WIN_DATA_REG, &Value32);
 #endif
-    MM_RELEASE_UNDI_LOCK(pDevice);
-
-    return Value32;
-} /* LM_MemRdInd */
+       MM_RELEASE_UNDI_LOCK (pDevice);
 
+       return Value32;
+}                              /* LM_MemRdInd */
 
 /******************************************************************************/
 /* Description:                                                               */
@@ -144,168 +139,161 @@ LM_UINT32 MemAddr) {
 /* Return:                                                                    */
 /******************************************************************************/
 LM_VOID
-LM_MemWrInd(
-PLM_DEVICE_BLOCK pDevice,
-LM_UINT32 MemAddr,
-LM_UINT32 Value32) {
-    MM_ACQUIRE_UNDI_LOCK(pDevice);
+LM_MemWrInd (PLM_DEVICE_BLOCK pDevice, LM_UINT32 MemAddr, LM_UINT32 Value32)
+{
+       MM_ACQUIRE_UNDI_LOCK (pDevice);
 #ifdef BIG_ENDIAN_HOST
-    REG_WR(pDevice,PciCfg.MemWindowBaseAddr,MemAddr);
-    REG_WR(pDevice,uIntMem.Mbuf[(MemAddr & 0x7fff)/4],Value32);
+       REG_WR (pDevice, PciCfg.MemWindowBaseAddr, MemAddr);
+       REG_WR (pDevice, uIntMem.Mbuf[(MemAddr & 0x7fff) / 4], Value32);
 #else
-    MM_WriteConfig32(pDevice, T3_PCI_MEM_WIN_ADDR_REG, MemAddr);
-    MM_WriteConfig32(pDevice, T3_PCI_MEM_WIN_DATA_REG, Value32);
+       MM_WriteConfig32 (pDevice, T3_PCI_MEM_WIN_ADDR_REG, MemAddr);
+       MM_WriteConfig32 (pDevice, T3_PCI_MEM_WIN_DATA_REG, Value32);
 #endif
-    MM_RELEASE_UNDI_LOCK(pDevice);
-} /* LM_MemWrInd */
-
+       MM_RELEASE_UNDI_LOCK (pDevice);
+}                              /* LM_MemWrInd */
 
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
 /* Return:                                                                    */
 /******************************************************************************/
-LM_STATUS
-LM_QueueRxPackets(
-PLM_DEVICE_BLOCK pDevice) {
-    LM_STATUS Lmstatus;
-    PLM_PACKET pPacket;
-    PT3_RCV_BD pRcvBd;
-    LM_UINT32 StdBdAdded = 0;
+LM_STATUS LM_QueueRxPackets (PLM_DEVICE_BLOCK pDevice)
+{
+       LM_STATUS Lmstatus;
+       PLM_PACKET pPacket;
+       PT3_RCV_BD pRcvBd;
+       LM_UINT32 StdBdAdded = 0;
 #if T3_JUMBO_RCV_RCB_ENTRY_COUNT
-    LM_UINT32 JumboBdAdded = 0;
-#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
+       LM_UINT32 JumboBdAdded = 0;
+#endif                         /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
 
-    Lmstatus = LM_STATUS_SUCCESS;
+       Lmstatus = LM_STATUS_SUCCESS;
 
-    pPacket = (PLM_PACKET) QQ_PopHead(&pDevice->RxPacketFreeQ.Container);
-    while(pPacket) {
-       switch(pPacket->u.Rx.RcvProdRing) {
+       pPacket = (PLM_PACKET) QQ_PopHead (&pDevice->RxPacketFreeQ.Container);
+       while (pPacket) {
+               switch (pPacket->u.Rx.RcvProdRing) {
 #if T3_JUMBO_RCV_RCB_ENTRY_COUNT
-           case T3_JUMBO_RCV_PROD_RING:        /* Jumbo Receive Ring. */
-               /* Initialize the buffer descriptor. */
-               pRcvBd =
-                   &pDevice->pRxJumboBdVirt[pDevice->RxJumboProdIdx];
-               pRcvBd->Flags = RCV_BD_FLAG_END | RCV_BD_FLAG_JUMBO_RING;
-               pRcvBd->Len = (LM_UINT16) pDevice->RxJumboBufferSize;
-
-               /* Initialize the receive buffer pointer */
-#if 0 /* Jimmy, deleted in new */
-               pRcvBd->HostAddr.Low = pPacket->u.Rx.RxBufferPhy.Low;
-               pRcvBd->HostAddr.High = pPacket->u.Rx.RxBufferPhy.High;
+               case T3_JUMBO_RCV_PROD_RING:    /* Jumbo Receive Ring. */
+                       /* Initialize the buffer descriptor. */
+                       pRcvBd =
+                           &pDevice->pRxJumboBdVirt[pDevice->RxJumboProdIdx];
+                       pRcvBd->Flags =
+                           RCV_BD_FLAG_END | RCV_BD_FLAG_JUMBO_RING;
+                       pRcvBd->Len = (LM_UINT16) pDevice->RxJumboBufferSize;
+
+                       /* Initialize the receive buffer pointer */
+#if 0                          /* Jimmy, deleted in new */
+                       pRcvBd->HostAddr.Low = pPacket->u.Rx.RxBufferPhy.Low;
+                       pRcvBd->HostAddr.High = pPacket->u.Rx.RxBufferPhy.High;
 #endif
-               MM_MapRxDma(pDevice, pPacket, &pRcvBd->HostAddr);
+                       MM_MapRxDma (pDevice, pPacket, &pRcvBd->HostAddr);
 
-               /* The opaque field may point to an offset from a fix addr. */
-               pRcvBd->Opaque = (LM_UINT32) (MM_UINT_PTR(pPacket) -
-                   MM_UINT_PTR(pDevice->pPacketDescBase));
+                       /* The opaque field may point to an offset from a fix addr. */
+                       pRcvBd->Opaque = (LM_UINT32) (MM_UINT_PTR (pPacket) -
+                                                     MM_UINT_PTR (pDevice->
+                                                                  pPacketDescBase));
 
-               /* Update the producer index. */
-               pDevice->RxJumboProdIdx = (pDevice->RxJumboProdIdx + 1) &
-                   T3_JUMBO_RCV_RCB_ENTRY_COUNT_MASK;
+                       /* Update the producer index. */
+                       pDevice->RxJumboProdIdx =
+                           (pDevice->RxJumboProdIdx +
+                            1) & T3_JUMBO_RCV_RCB_ENTRY_COUNT_MASK;
 
-               JumboBdAdded++;
-               break;
-#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
-
-           case T3_STD_RCV_PROD_RING:      /* Standard Receive Ring. */
-               /* Initialize the buffer descriptor. */
-               pRcvBd = &pDevice->pRxStdBdVirt[pDevice->RxStdProdIdx];
-               pRcvBd->Flags = RCV_BD_FLAG_END;
-               pRcvBd->Len = MAX_STD_RCV_BUFFER_SIZE;
-
-               /* Initialize the receive buffer pointer */
-#if 0  /* Jimmy, deleted in new replaced with MM_MapRxDma */
-               pRcvBd->HostAddr.Low = pPacket->u.Rx.RxBufferPhy.Low;
-               pRcvBd->HostAddr.High = pPacket->u.Rx.RxBufferPhy.High;
+                       JumboBdAdded++;
+                       break;
+#endif                         /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
+
+               case T3_STD_RCV_PROD_RING:      /* Standard Receive Ring. */
+                       /* Initialize the buffer descriptor. */
+                       pRcvBd = &pDevice->pRxStdBdVirt[pDevice->RxStdProdIdx];
+                       pRcvBd->Flags = RCV_BD_FLAG_END;
+                       pRcvBd->Len = MAX_STD_RCV_BUFFER_SIZE;
+
+                       /* Initialize the receive buffer pointer */
+#if 0                          /* Jimmy, deleted in new replaced with MM_MapRxDma */
+                       pRcvBd->HostAddr.Low = pPacket->u.Rx.RxBufferPhy.Low;
+                       pRcvBd->HostAddr.High = pPacket->u.Rx.RxBufferPhy.High;
 #endif
-               MM_MapRxDma(pDevice, pPacket, &pRcvBd->HostAddr);
+                       MM_MapRxDma (pDevice, pPacket, &pRcvBd->HostAddr);
 
-               /* The opaque field may point to an offset from a fix addr. */
-               pRcvBd->Opaque = (LM_UINT32) (MM_UINT_PTR(pPacket) -
-                   MM_UINT_PTR(pDevice->pPacketDescBase));
+                       /* The opaque field may point to an offset from a fix addr. */
+                       pRcvBd->Opaque = (LM_UINT32) (MM_UINT_PTR (pPacket) -
+                                                     MM_UINT_PTR (pDevice->
+                                                                  pPacketDescBase));
 
-               /* Update the producer index. */
-               pDevice->RxStdProdIdx = (pDevice->RxStdProdIdx + 1) &
-                   T3_STD_RCV_RCB_ENTRY_COUNT_MASK;
+                       /* Update the producer index. */
+                       pDevice->RxStdProdIdx = (pDevice->RxStdProdIdx + 1) &
+                           T3_STD_RCV_RCB_ENTRY_COUNT_MASK;
 
-               StdBdAdded++;
-               break;
+                       StdBdAdded++;
+                       break;
 
-           case T3_UNKNOWN_RCV_PROD_RING:
-           default:
-               Lmstatus = LM_STATUS_FAILURE;
-               break;
-       } /* switch */
+               case T3_UNKNOWN_RCV_PROD_RING:
+               default:
+                       Lmstatus = LM_STATUS_FAILURE;
+                       break;
+               }               /* switch */
 
-       /* Bail out if there is any error. */
-       if(Lmstatus != LM_STATUS_SUCCESS)
-       {
-           break;
-       }
+               /* Bail out if there is any error. */
+               if (Lmstatus != LM_STATUS_SUCCESS) {
+                       break;
+               }
 
-       pPacket = (PLM_PACKET) QQ_PopHead(&pDevice->RxPacketFreeQ.Container);
-    } /* while */
+               pPacket =
+                   (PLM_PACKET) QQ_PopHead (&pDevice->RxPacketFreeQ.Container);
+       }                       /* while */
 
-    wmb();
-    /* Update the procedure index. */
-    if(StdBdAdded)
-    {
-       MB_REG_WR(pDevice, Mailbox.RcvStdProdIdx.Low, pDevice->RxStdProdIdx);
-    }
+       wmb ();
+       /* Update the procedure index. */
+       if (StdBdAdded) {
+               MB_REG_WR (pDevice, Mailbox.RcvStdProdIdx.Low,
+                          pDevice->RxStdProdIdx);
+       }
 #if T3_JUMBO_RCV_RCB_ENTRY_COUNT
-    if(JumboBdAdded)
-    {
-       MB_REG_WR(pDevice, Mailbox.RcvJumboProdIdx.Low,
-           pDevice->RxJumboProdIdx);
-    }
-#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
-
-    return Lmstatus;
-} /* LM_QueueRxPackets */
+       if (JumboBdAdded) {
+               MB_REG_WR (pDevice, Mailbox.RcvJumboProdIdx.Low,
+                          pDevice->RxJumboProdIdx);
+       }
+#endif                         /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
 
+       return Lmstatus;
+}                              /* LM_QueueRxPackets */
 
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
 /* Return:                                                                    */
 /******************************************************************************/
-STATIC LM_VOID
-LM_NvramInit(
-    PLM_DEVICE_BLOCK pDevice)
+STATIC LM_VOID LM_NvramInit (PLM_DEVICE_BLOCK pDevice)
 {
-    LM_UINT32 Value32;
-    LM_UINT32 j;
-
-    /* Intialize clock period and state machine. */
-    Value32 = SEEPROM_ADDR_CLK_PERD(SEEPROM_CLOCK_PERIOD) |
-       SEEPROM_ADDR_FSM_RESET;
-    REG_WR(pDevice, Grc.EepromAddr, Value32);
-
-    for(j = 0; j < 100; j++)
-    {
-       MM_Wait(10);
-    }
-
-    /* Serial eeprom access using the Grc.EepromAddr/EepromData registers. */
-    Value32 = REG_RD(pDevice, Grc.LocalCtrl);
-    REG_WR(pDevice, Grc.LocalCtrl, Value32 | GRC_MISC_LOCAL_CTRL_AUTO_SEEPROM);
-
-    /* Set the 5701 compatibility mode if we are using EEPROM. */
-    if(T3_ASIC_REV(pDevice->ChipRevId) != T3_ASIC_REV_5700 &&
-       T3_ASIC_REV(pDevice->ChipRevId) != T3_ASIC_REV_5701)
-    {
-       Value32 = REG_RD(pDevice, Nvram.Config1);
-       if((Value32 & FLASH_INTERFACE_ENABLE) == 0)
-       {
-           /* Use the new interface to read EEPROM. */
-           Value32 &= ~FLASH_COMPAT_BYPASS;
+       LM_UINT32 Value32;
+       LM_UINT32 j;
 
-           REG_WR(pDevice, Nvram.Config1, Value32);
+       /* Intialize clock period and state machine. */
+       Value32 = SEEPROM_ADDR_CLK_PERD (SEEPROM_CLOCK_PERIOD) |
+           SEEPROM_ADDR_FSM_RESET;
+       REG_WR (pDevice, Grc.EepromAddr, Value32);
+
+       for (j = 0; j < 100; j++) {
+               MM_Wait (10);
        }
-    }
-} /* LM_NvRamInit */
 
+       /* Serial eeprom access using the Grc.EepromAddr/EepromData registers. */
+       Value32 = REG_RD (pDevice, Grc.LocalCtrl);
+       REG_WR (pDevice, Grc.LocalCtrl,
+               Value32 | GRC_MISC_LOCAL_CTRL_AUTO_SEEPROM);
+
+       /* Set the 5701 compatibility mode if we are using EEPROM. */
+       if (T3_ASIC_REV (pDevice->ChipRevId) != T3_ASIC_REV_5700 &&
+           T3_ASIC_REV (pDevice->ChipRevId) != T3_ASIC_REV_5701) {
+               Value32 = REG_RD (pDevice, Nvram.Config1);
+               if ((Value32 & FLASH_INTERFACE_ENABLE) == 0) {
+                       /* Use the new interface to read EEPROM. */
+                       Value32 &= ~FLASH_COMPAT_BYPASS;
+
+                       REG_WR (pDevice, Nvram.Config1, Value32);
+               }
+       }
+}                              /* LM_NvRamInit */
 
 /******************************************************************************/
 /* Description:                                                               */
@@ -313,51 +301,44 @@ LM_NvramInit(
 /* Return:                                                                    */
 /******************************************************************************/
 STATIC LM_STATUS
-LM_EepromRead(
-    PLM_DEVICE_BLOCK pDevice,
-    LM_UINT32 Offset,
-    LM_UINT32 *pData)
+LM_EepromRead (PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset, LM_UINT32 * pData)
 {
-    LM_UINT32 Value32;
-    LM_UINT32 Addr;
-    LM_UINT32 Dev;
-    LM_UINT32 j;
+       LM_UINT32 Value32;
+       LM_UINT32 Addr;
+       LM_UINT32 Dev;
+       LM_UINT32 j;
 
-    if(Offset > SEEPROM_CHIP_SIZE)
-    {
-       return LM_STATUS_FAILURE;
-    }
+       if (Offset > SEEPROM_CHIP_SIZE) {
+               return LM_STATUS_FAILURE;
+       }
 
-    Dev = Offset / SEEPROM_CHIP_SIZE;
-    Addr = Offset % SEEPROM_CHIP_SIZE;
+       Dev = Offset / SEEPROM_CHIP_SIZE;
+       Addr = Offset % SEEPROM_CHIP_SIZE;
 
-    Value32 = REG_RD(pDevice, Grc.EepromAddr);
-    Value32 &= ~(SEEPROM_ADDR_ADDRESS_MASK | SEEPROM_ADDR_DEV_ID_MASK |
-       SEEPROM_ADDR_RW_MASK);
-    REG_WR(pDevice, Grc.EepromAddr, Value32 | SEEPROM_ADDR_DEV_ID(Dev) |
-       SEEPROM_ADDR_ADDRESS(Addr) | SEEPROM_ADDR_START | SEEPROM_ADDR_READ);
+       Value32 = REG_RD (pDevice, Grc.EepromAddr);
+       Value32 &= ~(SEEPROM_ADDR_ADDRESS_MASK | SEEPROM_ADDR_DEV_ID_MASK |
+                    SEEPROM_ADDR_RW_MASK);
+       REG_WR (pDevice, Grc.EepromAddr, Value32 | SEEPROM_ADDR_DEV_ID (Dev) |
+               SEEPROM_ADDR_ADDRESS (Addr) | SEEPROM_ADDR_START |
+               SEEPROM_ADDR_READ);
 
-    for(j = 0; j < 1000; j++)
-    {
-       Value32 = REG_RD(pDevice, Grc.EepromAddr);
-       if(Value32 & SEEPROM_ADDR_COMPLETE)
-       {
-           break;
+       for (j = 0; j < 1000; j++) {
+               Value32 = REG_RD (pDevice, Grc.EepromAddr);
+               if (Value32 & SEEPROM_ADDR_COMPLETE) {
+                       break;
+               }
+               MM_Wait (10);
        }
-       MM_Wait(10);
-    }
-
-    if(Value32 & SEEPROM_ADDR_COMPLETE)
-    {
-       Value32 = REG_RD(pDevice, Grc.EepromData);
-       *pData = Value32;
 
-       return LM_STATUS_SUCCESS;
-    }
+       if (Value32 & SEEPROM_ADDR_COMPLETE) {
+               Value32 = REG_RD (pDevice, Grc.EepromData);
+               *pData = Value32;
 
-    return LM_STATUS_FAILURE;
-} /* LM_EepromRead */
+               return LM_STATUS_SUCCESS;
+       }
 
+       return LM_STATUS_FAILURE;
+}                              /* LM_EepromRead */
 
 /******************************************************************************/
 /* Description:                                                               */
@@ -365,291 +346,248 @@ LM_EepromRead(
 /* Return:                                                                    */
 /******************************************************************************/
 STATIC LM_STATUS
-LM_NvramRead(
-    PLM_DEVICE_BLOCK pDevice,
-    LM_UINT32 Offset,
-    LM_UINT32 *pData)
+LM_NvramRead (PLM_DEVICE_BLOCK pDevice, LM_UINT32 Offset, LM_UINT32 * pData)
 {
-    LM_UINT32 Value32;
-    LM_STATUS Status;
-    LM_UINT32 j;
-
-    if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 ||
-       T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701)
-    {
-       Status = LM_EepromRead(pDevice, Offset, pData);
-    }
-    else
-    {
-       /* Determine if we have flash or EEPROM. */
-       Value32 = REG_RD(pDevice, Nvram.Config1);
-       if(Value32 & FLASH_INTERFACE_ENABLE)
-       {
-           if(Value32 & FLASH_SSRAM_BUFFERRED_MODE)
-           {
-               Offset = ((Offset/BUFFERED_FLASH_PAGE_SIZE) <<
-                   BUFFERED_FLASH_PAGE_POS) +
-                   (Offset % BUFFERED_FLASH_PAGE_SIZE);
-           }
-       }
+       LM_UINT32 Value32;
+       LM_STATUS Status;
+       LM_UINT32 j;
+
+       if (T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5700 ||
+           T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5701) {
+               Status = LM_EepromRead (pDevice, Offset, pData);
+       } else {
+               /* Determine if we have flash or EEPROM. */
+               Value32 = REG_RD (pDevice, Nvram.Config1);
+               if (Value32 & FLASH_INTERFACE_ENABLE) {
+                       if (Value32 & FLASH_SSRAM_BUFFERRED_MODE) {
+                               Offset = ((Offset / BUFFERED_FLASH_PAGE_SIZE) <<
+                                         BUFFERED_FLASH_PAGE_POS) +
+                                   (Offset % BUFFERED_FLASH_PAGE_SIZE);
+                       }
+               }
 
-       REG_WR(pDevice, Nvram.SwArb, SW_ARB_REQ_SET1);
-       for (j = 0; j < 1000; j++)
-       {
-           if (REG_RD(pDevice, Nvram.SwArb) & SW_ARB_GNT1)
-           {
-               break;
-           }
-           MM_Wait(20);
-       }
-       if (j == 1000)
-       {
-           return LM_STATUS_FAILURE;
-       }
+               REG_WR (pDevice, Nvram.SwArb, SW_ARB_REQ_SET1);
+               for (j = 0; j < 1000; j++) {
+                       if (REG_RD (pDevice, Nvram.SwArb) & SW_ARB_GNT1) {
+                               break;
+                       }
+                       MM_Wait (20);
+               }
+               if (j == 1000) {
+                       return LM_STATUS_FAILURE;
+               }
 
-       /* Read from flash or EEPROM with the new 5703/02 interface. */
-       REG_WR(pDevice, Nvram.Addr, Offset & NVRAM_ADDRESS_MASK);
+               /* Read from flash or EEPROM with the new 5703/02 interface. */
+               REG_WR (pDevice, Nvram.Addr, Offset & NVRAM_ADDRESS_MASK);
 
-       REG_WR(pDevice, Nvram.Cmd, NVRAM_CMD_RD | NVRAM_CMD_DO_IT |
-           NVRAM_CMD_FIRST | NVRAM_CMD_LAST | NVRAM_CMD_DONE);
+               REG_WR (pDevice, Nvram.Cmd, NVRAM_CMD_RD | NVRAM_CMD_DO_IT |
+                       NVRAM_CMD_FIRST | NVRAM_CMD_LAST | NVRAM_CMD_DONE);
 
-       /* Wait for the done bit to clear. */
-       for(j = 0; j < 500; j++)
-       {
-           MM_Wait(10);
+               /* Wait for the done bit to clear. */
+               for (j = 0; j < 500; j++) {
+                       MM_Wait (10);
 
-           Value32 = REG_RD(pDevice, Nvram.Cmd);
-           if(!(Value32 & NVRAM_CMD_DONE))
-           {
-               break;
-           }
-       }
+                       Value32 = REG_RD (pDevice, Nvram.Cmd);
+                       if (!(Value32 & NVRAM_CMD_DONE)) {
+                               break;
+                       }
+               }
 
-       /* Wait for the done bit. */
-       if(!(Value32 & NVRAM_CMD_DONE))
-       {
-           for(j = 0; j < 500; j++)
-           {
-               MM_Wait(10);
+               /* Wait for the done bit. */
+               if (!(Value32 & NVRAM_CMD_DONE)) {
+                       for (j = 0; j < 500; j++) {
+                               MM_Wait (10);
 
-               Value32 = REG_RD(pDevice, Nvram.Cmd);
-               if(Value32 & NVRAM_CMD_DONE)
-               {
-                   MM_Wait(10);
+                               Value32 = REG_RD (pDevice, Nvram.Cmd);
+                               if (Value32 & NVRAM_CMD_DONE) {
+                                       MM_Wait (10);
 
-                   *pData = REG_RD(pDevice, Nvram.ReadData);
+                                       *pData =
+                                           REG_RD (pDevice, Nvram.ReadData);
 
-                   /* Change the endianess. */
-                   *pData = ((*pData & 0xff) << 24)| ((*pData & 0xff00) << 8)|
-                       ((*pData & 0xff0000) >> 8) | ((*pData >> 24) & 0xff);
+                                       /* Change the endianess. */
+                                       *pData =
+                                           ((*pData & 0xff) << 24) |
+                                           ((*pData & 0xff00) << 8) |
+                                           ((*pData & 0xff0000) >> 8) |
+                                           ((*pData >> 24) & 0xff);
 
-                   break;
+                                       break;
+                               }
+                       }
                }
-           }
-       }
 
-       REG_WR(pDevice, Nvram.SwArb, SW_ARB_REQ_CLR1);
-       if(Value32 & NVRAM_CMD_DONE)
-       {
-           Status = LM_STATUS_SUCCESS;
-       }
-       else
-       {
-           Status = LM_STATUS_FAILURE;
+               REG_WR (pDevice, Nvram.SwArb, SW_ARB_REQ_CLR1);
+               if (Value32 & NVRAM_CMD_DONE) {
+                       Status = LM_STATUS_SUCCESS;
+               } else {
+                       Status = LM_STATUS_FAILURE;
+               }
        }
-    }
-
-    return Status;
-} /* LM_NvramRead */
 
+       return Status;
+}                              /* LM_NvramRead */
 
-STATIC void
-LM_ReadVPD(PLM_DEVICE_BLOCK pDevice)
+STATIC void LM_ReadVPD (PLM_DEVICE_BLOCK pDevice)
 {
-    LM_UINT32 Vpd_arr[256/4];
-    LM_UINT8 *Vpd = (LM_UINT8 *) &Vpd_arr[0];
-    LM_UINT32 *Vpd_dptr = &Vpd_arr[0];
-    LM_UINT32 Value32;
-    unsigned int j;
-
-    /* Read PN from VPD */
-    for (j = 0; j < 256; j += 4, Vpd_dptr++ )
-    {
-       if (LM_NvramRead(pDevice, 0x100 + j, &Value32) != LM_STATUS_SUCCESS) {
-           printf("BCM570x: LM_ReadVPD: VPD read failed"
-                  " (no EEPROM onboard)\n");
-           return;
-       }
-       *Vpd_dptr = cpu_to_le32(Value32);
-    }
-    for (j = 0; j < 256; )
-    {
-       unsigned int Vpd_r_len;
-       unsigned int Vpd_r_end;
-
-       if ((Vpd[j] == 0x82) || (Vpd[j] == 0x91))
-       {
-           j = j + 3 + Vpd[j + 1] + (Vpd[j + 2] << 8);
-       }
-       else if (Vpd[j] == 0x90)
-       {
-           Vpd_r_len =  Vpd[j + 1] + (Vpd[j + 2] << 8);
-           j += 3;
-           Vpd_r_end = Vpd_r_len + j;
-           while (j < Vpd_r_end)
-           {
-               if ((Vpd[j] == 'P') && (Vpd[j + 1] == 'N'))
-               {
-                   unsigned int len = Vpd[j + 2];
-
-                   if (len <= 24)
-                   {
-                       memcpy(pDevice->PartNo, &Vpd[j + 3], len);
-                   }
-                   break;
+       LM_UINT32 Vpd_arr[256 / 4];
+       LM_UINT8 *Vpd = (LM_UINT8 *) & Vpd_arr[0];
+       LM_UINT32 *Vpd_dptr = &Vpd_arr[0];
+       LM_UINT32 Value32;
+       unsigned int j;
+
+       /* Read PN from VPD */
+       for (j = 0; j < 256; j += 4, Vpd_dptr++) {
+               if (LM_NvramRead (pDevice, 0x100 + j, &Value32) !=
+                   LM_STATUS_SUCCESS) {
+                       printf ("BCM570x: LM_ReadVPD: VPD read failed"
+                               " (no EEPROM onboard)\n");
+                       return;
                }
-               else
-               {
-                   if (Vpd[j + 2] == 0)
-                   {
+               *Vpd_dptr = cpu_to_le32 (Value32);
+       }
+       for (j = 0; j < 256;) {
+               unsigned int Vpd_r_len;
+               unsigned int Vpd_r_end;
+
+               if ((Vpd[j] == 0x82) || (Vpd[j] == 0x91)) {
+                       j = j + 3 + Vpd[j + 1] + (Vpd[j + 2] << 8);
+               } else if (Vpd[j] == 0x90) {
+                       Vpd_r_len = Vpd[j + 1] + (Vpd[j + 2] << 8);
+                       j += 3;
+                       Vpd_r_end = Vpd_r_len + j;
+                       while (j < Vpd_r_end) {
+                               if ((Vpd[j] == 'P') && (Vpd[j + 1] == 'N')) {
+                                       unsigned int len = Vpd[j + 2];
+
+                                       if (len <= 24) {
+                                               memcpy (pDevice->PartNo,
+                                                       &Vpd[j + 3], len);
+                                       }
+                                       break;
+                               } else {
+                                       if (Vpd[j + 2] == 0) {
+                                               break;
+                                       }
+                                       j = j + Vpd[j + 2];
+                               }
+                       }
+                       break;
+               } else {
                        break;
-                   }
-                   j = j + Vpd[j + 2];
                }
-           }
-           break;
        }
-       else {
-           break;
-       }
-    }
 }
 
-STATIC void
-LM_ReadBootCodeVersion(PLM_DEVICE_BLOCK pDevice)
+STATIC void LM_ReadBootCodeVersion (PLM_DEVICE_BLOCK pDevice)
 {
-    LM_UINT32 Value32, offset, ver_offset;
-    int i;
-
-    if (LM_NvramRead(pDevice, 0x0, &Value32) != LM_STATUS_SUCCESS)
-       return;
-    if (Value32 != 0xaa559966)
-       return;
-    if (LM_NvramRead(pDevice, 0xc, &offset) != LM_STATUS_SUCCESS)
-       return;
-
-    offset = ((offset & 0xff) << 24)| ((offset & 0xff00) << 8)|
-       ((offset & 0xff0000) >> 8) | ((offset >> 24) & 0xff);
-    if (LM_NvramRead(pDevice, offset, &Value32) != LM_STATUS_SUCCESS)
-       return;
-    if ((Value32 == 0x0300000e) &&
-       (LM_NvramRead(pDevice, offset + 4, &Value32) == LM_STATUS_SUCCESS) &&
-       (Value32 == 0)) {
-
-       if (LM_NvramRead(pDevice, offset + 8, &ver_offset) != LM_STATUS_SUCCESS)
-           return;
-       ver_offset = ((ver_offset & 0xff0000) >> 8) |
-           ((ver_offset >> 24) & 0xff);
-       for (i = 0; i < 16; i += 4) {
-           if (LM_NvramRead(pDevice, offset + ver_offset + i, &Value32) !=
-               LM_STATUS_SUCCESS)
-           {
+       LM_UINT32 Value32, offset, ver_offset;
+       int i;
+
+       if (LM_NvramRead (pDevice, 0x0, &Value32) != LM_STATUS_SUCCESS)
                return;
-           }
-           *((LM_UINT32 *) &pDevice->BootCodeVer[i]) = cpu_to_le32(Value32);
-       }
-    }
-    else {
-       char c;
+       if (Value32 != 0xaa559966)
+               return;
+       if (LM_NvramRead (pDevice, 0xc, &offset) != LM_STATUS_SUCCESS)
+               return;
+
+       offset = ((offset & 0xff) << 24) | ((offset & 0xff00) << 8) |
+           ((offset & 0xff0000) >> 8) | ((offset >> 24) & 0xff);
+       if (LM_NvramRead (pDevice, offset, &Value32) != LM_STATUS_SUCCESS)
+               return;
+       if ((Value32 == 0x0300000e) &&
+           (LM_NvramRead (pDevice, offset + 4, &Value32) == LM_STATUS_SUCCESS)
+           && (Value32 == 0)) {
+
+               if (LM_NvramRead (pDevice, offset + 8, &ver_offset) !=
+                   LM_STATUS_SUCCESS)
+                       return;
+               ver_offset = ((ver_offset & 0xff0000) >> 8) |
+                   ((ver_offset >> 24) & 0xff);
+               for (i = 0; i < 16; i += 4) {
+                       if (LM_NvramRead
+                           (pDevice, offset + ver_offset + i,
+                            &Value32) != LM_STATUS_SUCCESS) {
+                               return;
+                       }
+                       *((LM_UINT32 *) & pDevice->BootCodeVer[i]) =
+                           cpu_to_le32 (Value32);
+               }
+       } else {
+               char c;
 
-       if (LM_NvramRead(pDevice, 0x94, &Value32) != LM_STATUS_SUCCESS)
-           return;
+               if (LM_NvramRead (pDevice, 0x94, &Value32) != LM_STATUS_SUCCESS)
+                       return;
 
-       i = 0;
-       c = ((Value32 & 0xff0000) >> 16);
+               i = 0;
+               c = ((Value32 & 0xff0000) >> 16);
 
-       if (c < 10) {
-           pDevice->BootCodeVer[i++] = c + '0';
-       }
-       else {
-           pDevice->BootCodeVer[i++] = (c / 10) + '0';
-           pDevice->BootCodeVer[i++] = (c % 10) + '0';
-       }
-       pDevice->BootCodeVer[i++] = '.';
-       c = (Value32 & 0xff000000) >> 24;
-       if (c < 10) {
-           pDevice->BootCodeVer[i++] = c + '0';
-       }
-       else {
-           pDevice->BootCodeVer[i++] = (c / 10) + '0';
-           pDevice->BootCodeVer[i++] = (c % 10) + '0';
+               if (c < 10) {
+                       pDevice->BootCodeVer[i++] = c + '0';
+               } else {
+                       pDevice->BootCodeVer[i++] = (c / 10) + '0';
+                       pDevice->BootCodeVer[i++] = (c % 10) + '0';
+               }
+               pDevice->BootCodeVer[i++] = '.';
+               c = (Value32 & 0xff000000) >> 24;
+               if (c < 10) {
+                       pDevice->BootCodeVer[i++] = c + '0';
+               } else {
+                       pDevice->BootCodeVer[i++] = (c / 10) + '0';
+                       pDevice->BootCodeVer[i++] = (c % 10) + '0';
+               }
+               pDevice->BootCodeVer[i] = 0;
        }
-       pDevice->BootCodeVer[i] = 0;
-    }
 }
 
-STATIC void
-LM_GetBusSpeed(PLM_DEVICE_BLOCK pDevice)
+STATIC void LM_GetBusSpeed (PLM_DEVICE_BLOCK pDevice)
 {
-    LM_UINT32 PciState = pDevice->PciState;
-    LM_UINT32 ClockCtrl;
-    char *SpeedStr = "";
-
-    if (PciState & T3_PCI_STATE_32BIT_PCI_BUS)
-    {
-       strcpy(pDevice->BusSpeedStr, "32-bit ");
-    }
-    else
-    {
-       strcpy(pDevice->BusSpeedStr, "64-bit ");
-    }
-    if (PciState & T3_PCI_STATE_CONVENTIONAL_PCI_MODE)
-    {
-       strcat(pDevice->BusSpeedStr, "PCI ");
-       if (PciState & T3_PCI_STATE_HIGH_BUS_SPEED)
-       {
-           SpeedStr = "66MHz";
-       }
-       else
-       {
-           SpeedStr = "33MHz";
-       }
-    }
-    else
-    {
-       strcat(pDevice->BusSpeedStr, "PCIX ");
-       if (pDevice->BondId == GRC_MISC_BD_ID_5704CIOBE)
-       {
-           SpeedStr = "133MHz";
-       }
-       else
-       {
-           ClockCtrl = REG_RD(pDevice, PciCfg.ClockCtrl) & 0x1f;
-           switch (ClockCtrl)
-           {
-           case 0:
-               SpeedStr = "33MHz";
-               break;
-
-           case 2:
-               SpeedStr = "50MHz";
-               break;
-
-           case 4:
-               SpeedStr = "66MHz";
-               break;
-
-           case 6:
-               SpeedStr = "100MHz";
-               break;
-
-           case 7:
-               SpeedStr = "133MHz";
-               break;
-           }
+       LM_UINT32 PciState = pDevice->PciState;
+       LM_UINT32 ClockCtrl;
+       char *SpeedStr = "";
+
+       if (PciState & T3_PCI_STATE_32BIT_PCI_BUS) {
+               strcpy (pDevice->BusSpeedStr, "32-bit ");
+       } else {
+               strcpy (pDevice->BusSpeedStr, "64-bit ");
+       }
+       if (PciState & T3_PCI_STATE_CONVENTIONAL_PCI_MODE) {
+               strcat (pDevice->BusSpeedStr, "PCI ");
+               if (PciState & T3_PCI_STATE_HIGH_BUS_SPEED) {
+                       SpeedStr = "66MHz";
+               } else {
+                       SpeedStr = "33MHz";
+               }
+       } else {
+               strcat (pDevice->BusSpeedStr, "PCIX ");
+               if (pDevice->BondId == GRC_MISC_BD_ID_5704CIOBE) {
+                       SpeedStr = "133MHz";
+               } else {
+                       ClockCtrl = REG_RD (pDevice, PciCfg.ClockCtrl) & 0x1f;
+                       switch (ClockCtrl) {
+                       case 0:
+                               SpeedStr = "33MHz";
+                               break;
+
+                       case 2:
+                               SpeedStr = "50MHz";
+                               break;
+
+                       case 4:
+                               SpeedStr = "66MHz";
+                               break;
+
+                       case 6:
+                               SpeedStr = "100MHz";
+                               break;
+
+                       case 7:
+                               SpeedStr = "133MHz";
+                               break;
+                       }
+               }
        }
-    }
-    strcat(pDevice->BusSpeedStr, SpeedStr);
+       strcat (pDevice->BusSpeedStr, SpeedStr);
 }
 
 /******************************************************************************/
@@ -660,977 +598,890 @@ LM_GetBusSpeed(PLM_DEVICE_BLOCK pDevice)
 /* Return:                                                                    */
 /*    LM_STATUS_SUCCESS                                                       */
 /******************************************************************************/
-LM_STATUS
-LM_GetAdapterInfo(
-PLM_DEVICE_BLOCK pDevice)
+LM_STATUS LM_GetAdapterInfo (PLM_DEVICE_BLOCK pDevice)
 {
-    PLM_ADAPTER_INFO pAdapterInfo;
-    LM_UINT32 Value32;
-    LM_STATUS Status;
-    LM_UINT32 j;
-    LM_UINT32 EeSigFound;
-    LM_UINT32 EePhyTypeSerdes = 0;
-    LM_UINT32 EePhyLedMode = 0;
-    LM_UINT32 EePhyId = 0;
-
-    /* Get Device Id and Vendor Id */
-    Status = MM_ReadConfig32(pDevice, PCI_VENDOR_ID_REG, &Value32);
-    if(Status != LM_STATUS_SUCCESS)
-    {
-       return Status;
-    }
-    pDevice->PciVendorId = (LM_UINT16) Value32;
-    pDevice->PciDeviceId = (LM_UINT16) (Value32 >> 16);
-
-    /* If we are not getting the write adapter, exit. */
-    if((Value32 != T3_PCI_ID_BCM5700) &&
-       (Value32 != T3_PCI_ID_BCM5701) &&
-       (Value32 != T3_PCI_ID_BCM5702) &&
-       (Value32 != T3_PCI_ID_BCM5702x) &&
-       (Value32 != T3_PCI_ID_BCM5702FE) &&
-       (Value32 != T3_PCI_ID_BCM5703) &&
-       (Value32 != T3_PCI_ID_BCM5703x) &&
-       (Value32 != T3_PCI_ID_BCM5704))
-    {
-       return LM_STATUS_FAILURE;
-    }
+       PLM_ADAPTER_INFO pAdapterInfo;
+       LM_UINT32 Value32;
+       LM_STATUS Status;
+       LM_UINT32 j;
+       LM_UINT32 EeSigFound;
+       LM_UINT32 EePhyTypeSerdes = 0;
+       LM_UINT32 EePhyLedMode = 0;
+       LM_UINT32 EePhyId = 0;
+
+       /* Get Device Id and Vendor Id */
+       Status = MM_ReadConfig32 (pDevice, PCI_VENDOR_ID_REG, &Value32);
+       if (Status != LM_STATUS_SUCCESS) {
+               return Status;
+       }
+       pDevice->PciVendorId = (LM_UINT16) Value32;
+       pDevice->PciDeviceId = (LM_UINT16) (Value32 >> 16);
+
+       /* If we are not getting the write adapter, exit. */
+       if ((Value32 != T3_PCI_ID_BCM5700) &&
+           (Value32 != T3_PCI_ID_BCM5701) &&
+           (Value32 != T3_PCI_ID_BCM5702) &&
+           (Value32 != T3_PCI_ID_BCM5702x) &&
+           (Value32 != T3_PCI_ID_BCM5702FE) &&
+           (Value32 != T3_PCI_ID_BCM5703) &&
+           (Value32 != T3_PCI_ID_BCM5703x) && (Value32 != T3_PCI_ID_BCM5704)) {
+               return LM_STATUS_FAILURE;
+       }
 
-    Status = MM_ReadConfig32(pDevice, PCI_REV_ID_REG, &Value32);
-    if(Status != LM_STATUS_SUCCESS)
-    {
-       return Status;
-    }
-    pDevice->PciRevId = (LM_UINT8) Value32;
+       Status = MM_ReadConfig32 (pDevice, PCI_REV_ID_REG, &Value32);
+       if (Status != LM_STATUS_SUCCESS) {
+               return Status;
+       }
+       pDevice->PciRevId = (LM_UINT8) Value32;
 
-    /* Get IRQ. */
-    Status = MM_ReadConfig32(pDevice, PCI_INT_LINE_REG, &Value32);
-    if(Status != LM_STATUS_SUCCESS)
-    {
-       return Status;
-    }
-    pDevice->Irq = (LM_UINT8) Value32;
+       /* Get IRQ. */
+       Status = MM_ReadConfig32 (pDevice, PCI_INT_LINE_REG, &Value32);
+       if (Status != LM_STATUS_SUCCESS) {
+               return Status;
+       }
+       pDevice->Irq = (LM_UINT8) Value32;
 
-    /* Get interrupt pin. */
-    pDevice->IntPin = (LM_UINT8) (Value32 >> 8);
+       /* Get interrupt pin. */
+       pDevice->IntPin = (LM_UINT8) (Value32 >> 8);
 
-    /* Get chip revision id. */
-    Status = MM_ReadConfig32(pDevice, T3_PCI_MISC_HOST_CTRL_REG, &Value32);
-    pDevice->ChipRevId = Value32 >> 16;
+       /* Get chip revision id. */
+       Status = MM_ReadConfig32 (pDevice, T3_PCI_MISC_HOST_CTRL_REG, &Value32);
+       pDevice->ChipRevId = Value32 >> 16;
 
-    /* Get subsystem vendor. */
-    Status = MM_ReadConfig32(pDevice, PCI_SUBSYSTEM_VENDOR_ID_REG, &Value32);
-    if(Status != LM_STATUS_SUCCESS)
-    {
-       return Status;
-    }
-    pDevice->SubsystemVendorId = (LM_UINT16) Value32;
+       /* Get subsystem vendor. */
+       Status =
+           MM_ReadConfig32 (pDevice, PCI_SUBSYSTEM_VENDOR_ID_REG, &Value32);
+       if (Status != LM_STATUS_SUCCESS) {
+               return Status;
+       }
+       pDevice->SubsystemVendorId = (LM_UINT16) Value32;
 
-    /* Get PCI subsystem id. */
-    pDevice->SubsystemId = (LM_UINT16) (Value32 >> 16);
+       /* Get PCI subsystem id. */
+       pDevice->SubsystemId = (LM_UINT16) (Value32 >> 16);
 
-    /* Get the cache line size. */
-    MM_ReadConfig32(pDevice, PCI_CACHE_LINE_SIZE_REG, &Value32);
-    pDevice->CacheLineSize = (LM_UINT8) Value32;
-    pDevice->SavedCacheLineReg = Value32;
+       /* Get the cache line size. */
+       MM_ReadConfig32 (pDevice, PCI_CACHE_LINE_SIZE_REG, &Value32);
+       pDevice->CacheLineSize = (LM_UINT8) Value32;
+       pDevice->SavedCacheLineReg = Value32;
 
-    if(pDevice->ChipRevId != T3_CHIP_ID_5703_A1 &&
-       pDevice->ChipRevId != T3_CHIP_ID_5703_A2 &&
-       pDevice->ChipRevId != T3_CHIP_ID_5704_A0)
-    {
-       pDevice->UndiFix = FALSE;
-    }
+       if (pDevice->ChipRevId != T3_CHIP_ID_5703_A1 &&
+           pDevice->ChipRevId != T3_CHIP_ID_5703_A2 &&
+           pDevice->ChipRevId != T3_CHIP_ID_5704_A0) {
+               pDevice->UndiFix = FALSE;
+       }
 #if !PCIX_TARGET_WORKAROUND
-    pDevice->UndiFix = FALSE;
+       pDevice->UndiFix = FALSE;
 #endif
-    /* Map the memory base to system address space. */
-    if (!pDevice->UndiFix)
-    {
-       Status = MM_MapMemBase(pDevice);
-       if(Status != LM_STATUS_SUCCESS)
-       {
-           return Status;
+       /* Map the memory base to system address space. */
+       if (!pDevice->UndiFix) {
+               Status = MM_MapMemBase (pDevice);
+               if (Status != LM_STATUS_SUCCESS) {
+                       return Status;
+               }
+               /* Initialize the memory view pointer. */
+               pDevice->pMemView = (PT3_STD_MEM_MAP) pDevice->pMappedMemBase;
        }
-       /* Initialize the memory view pointer. */
-       pDevice->pMemView = (PT3_STD_MEM_MAP) pDevice->pMappedMemBase;
-    }
-
 #if PCIX_TARGET_WORKAROUND
-    /* store whether we are in PCI are PCI-X mode */
-    pDevice->EnablePciXFix = FALSE;
-
-    MM_ReadConfig32(pDevice, T3_PCI_STATE_REG, &Value32);
-    if((Value32 & T3_PCI_STATE_CONVENTIONAL_PCI_MODE) == 0)
-    {
-       /* Enable PCI-X workaround only if we are running on 5700 BX. */
-       if(T3_CHIP_REV(pDevice->ChipRevId) == T3_CHIP_REV_5700_BX)
-       {
-           pDevice->EnablePciXFix = TRUE;
+       /* store whether we are in PCI are PCI-X mode */
+       pDevice->EnablePciXFix = FALSE;
+
+       MM_ReadConfig32 (pDevice, T3_PCI_STATE_REG, &Value32);
+       if ((Value32 & T3_PCI_STATE_CONVENTIONAL_PCI_MODE) == 0) {
+               /* Enable PCI-X workaround only if we are running on 5700 BX. */
+               if (T3_CHIP_REV (pDevice->ChipRevId) == T3_CHIP_REV_5700_BX) {
+                       pDevice->EnablePciXFix = TRUE;
+               }
+       }
+       if (pDevice->UndiFix) {
+               pDevice->EnablePciXFix = TRUE;
        }
-    }
-    if (pDevice->UndiFix)
-    {
-       pDevice->EnablePciXFix = TRUE;
-    }
 #endif
-    /* Bx bug: due to the "byte_enable bug" in PCI-X mode, the power */
-    /* management register may be clobbered which may cause the */
-    /* BCM5700 to go into D3 state.  While in this state, we will */
-    /* not have memory mapped register access.  As a workaround, we */
-    /* need to restore the device to D0 state. */
-    MM_ReadConfig32(pDevice, T3_PCI_PM_STATUS_CTRL_REG, &Value32);
-    Value32 |= T3_PM_PME_ASSERTED;
-    Value32 &= ~T3_PM_POWER_STATE_MASK;
-    Value32 |= T3_PM_POWER_STATE_D0;
-    MM_WriteConfig32(pDevice, T3_PCI_PM_STATUS_CTRL_REG, Value32);
-
-    /* read the current PCI command word */
-    MM_ReadConfig32(pDevice, PCI_COMMAND_REG, &Value32);
-
-    /* Make sure bus-mastering is enabled. */
-    Value32 |= PCI_BUSMASTER_ENABLE;
+       /* Bx bug: due to the "byte_enable bug" in PCI-X mode, the power */
+       /* management register may be clobbered which may cause the */
+       /* BCM5700 to go into D3 state.  While in this state, we will */
+       /* not have memory mapped register access.  As a workaround, we */
+       /* need to restore the device to D0 state. */
+       MM_ReadConfig32 (pDevice, T3_PCI_PM_STATUS_CTRL_REG, &Value32);
+       Value32 |= T3_PM_PME_ASSERTED;
+       Value32 &= ~T3_PM_POWER_STATE_MASK;
+       Value32 |= T3_PM_POWER_STATE_D0;
+       MM_WriteConfig32 (pDevice, T3_PCI_PM_STATUS_CTRL_REG, Value32);
+
+       /* read the current PCI command word */
+       MM_ReadConfig32 (pDevice, PCI_COMMAND_REG, &Value32);
+
+       /* Make sure bus-mastering is enabled. */
+       Value32 |= PCI_BUSMASTER_ENABLE;
 
 #if PCIX_TARGET_WORKAROUND
-    /* if we are in PCI-X mode, also make sure mem-mapping and SERR#/PERR#
-       are enabled */
-    if (pDevice->EnablePciXFix == TRUE) {
-       Value32 |= (PCI_MEM_SPACE_ENABLE | PCI_SYSTEM_ERROR_ENABLE |
-                   PCI_PARITY_ERROR_ENABLE);
-    }
-    if (pDevice->UndiFix)
-    {
-       Value32 &= ~PCI_MEM_SPACE_ENABLE;
-    }
-
+       /* if we are in PCI-X mode, also make sure mem-mapping and SERR#/PERR#
+          are enabled */
+       if (pDevice->EnablePciXFix == TRUE) {
+               Value32 |= (PCI_MEM_SPACE_ENABLE | PCI_SYSTEM_ERROR_ENABLE |
+                           PCI_PARITY_ERROR_ENABLE);
+       }
+       if (pDevice->UndiFix) {
+               Value32 &= ~PCI_MEM_SPACE_ENABLE;
+       }
 #endif
 
-    if(pDevice->EnableMWI)
-    {
-       Value32 |= PCI_MEMORY_WRITE_INVALIDATE;
-    }
-    else {
-       Value32 &= (~PCI_MEMORY_WRITE_INVALIDATE);
-    }
-
-    /* Error out if mem-mapping is NOT enabled for PCI systems */
-    if (!(Value32 | PCI_MEM_SPACE_ENABLE))
-    {
-       return LM_STATUS_FAILURE;
-    }
+       if (pDevice->EnableMWI) {
+               Value32 |= PCI_MEMORY_WRITE_INVALIDATE;
+       } else {
+               Value32 &= (~PCI_MEMORY_WRITE_INVALIDATE);
+       }
+
+       /* Error out if mem-mapping is NOT enabled for PCI systems */
+       if (!(Value32 | PCI_MEM_SPACE_ENABLE)) {
+               return LM_STATUS_FAILURE;
+       }
 
-    /* save the value we are going to write into the PCI command word */
-    pDevice->PciCommandStatusWords = Value32;
+       /* save the value we are going to write into the PCI command word */
+       pDevice->PciCommandStatusWords = Value32;
 
-    Status = MM_WriteConfig32(pDevice, PCI_COMMAND_REG, Value32);
-    if(Status != LM_STATUS_SUCCESS)
-    {
-       return Status;
-    }
+       Status = MM_WriteConfig32 (pDevice, PCI_COMMAND_REG, Value32);
+       if (Status != LM_STATUS_SUCCESS) {
+               return Status;
+       }
 
-    /* Set power state to D0. */
-    LM_SetPowerState(pDevice, LM_POWER_STATE_D0);
+       /* Set power state to D0. */
+       LM_SetPowerState (pDevice, LM_POWER_STATE_D0);
 
 #ifdef BIG_ENDIAN_PCI
-    pDevice->MiscHostCtrl =
-       MISC_HOST_CTRL_MASK_PCI_INT |
-       MISC_HOST_CTRL_ENABLE_INDIRECT_ACCESS |
-       MISC_HOST_CTRL_ENABLE_ENDIAN_WORD_SWAP |
-       MISC_HOST_CTRL_ENABLE_PCI_STATE_REG_RW;
-#else /* No CPU Swap modes for PCI IO */
-
-    /* Setup the mode registers. */
-    pDevice->MiscHostCtrl =
-       MISC_HOST_CTRL_MASK_PCI_INT |
-       MISC_HOST_CTRL_ENABLE_ENDIAN_WORD_SWAP |
+       pDevice->MiscHostCtrl =
+           MISC_HOST_CTRL_MASK_PCI_INT |
+           MISC_HOST_CTRL_ENABLE_INDIRECT_ACCESS |
+           MISC_HOST_CTRL_ENABLE_ENDIAN_WORD_SWAP |
+           MISC_HOST_CTRL_ENABLE_PCI_STATE_REG_RW;
+#else                          /* No CPU Swap modes for PCI IO */
+
+       /* Setup the mode registers. */
+       pDevice->MiscHostCtrl =
+           MISC_HOST_CTRL_MASK_PCI_INT |
+           MISC_HOST_CTRL_ENABLE_ENDIAN_WORD_SWAP |
 #ifdef BIG_ENDIAN_HOST
-       MISC_HOST_CTRL_ENABLE_ENDIAN_BYTE_SWAP |
-#endif /* BIG_ENDIAN_HOST */
-       MISC_HOST_CTRL_ENABLE_INDIRECT_ACCESS |
-       MISC_HOST_CTRL_ENABLE_PCI_STATE_REG_RW;
-#endif /* !BIG_ENDIAN_PCI */
+           MISC_HOST_CTRL_ENABLE_ENDIAN_BYTE_SWAP |
+#endif                         /* BIG_ENDIAN_HOST */
+           MISC_HOST_CTRL_ENABLE_INDIRECT_ACCESS |
+           MISC_HOST_CTRL_ENABLE_PCI_STATE_REG_RW;
+#endif                         /* !BIG_ENDIAN_PCI */
 
-    /* write to PCI misc host ctr first in order to enable indirect accesses */
-    MM_WriteConfig32(pDevice, T3_PCI_MISC_HOST_CTRL_REG, pDevice->MiscHostCtrl);
+       /* write to PCI misc host ctr first in order to enable indirect accesses */
+       MM_WriteConfig32 (pDevice, T3_PCI_MISC_HOST_CTRL_REG,
+                         pDevice->MiscHostCtrl);
 
-    REG_WR(pDevice, PciCfg.MiscHostCtrl, pDevice->MiscHostCtrl);
+       REG_WR (pDevice, PciCfg.MiscHostCtrl, pDevice->MiscHostCtrl);
 
 #ifdef BIG_ENDIAN_PCI
-    Value32 = GRC_MODE_WORD_SWAP_DATA|
-             GRC_MODE_WORD_SWAP_NON_FRAME_DATA;
+       Value32 = GRC_MODE_WORD_SWAP_DATA | GRC_MODE_WORD_SWAP_NON_FRAME_DATA;
 #else
 /* No CPU Swap modes for PCI IO */
 #ifdef BIG_ENDIAN_HOST
-    Value32 = GRC_MODE_BYTE_SWAP_NON_FRAME_DATA |
-             GRC_MODE_WORD_SWAP_NON_FRAME_DATA;
+       Value32 = GRC_MODE_BYTE_SWAP_NON_FRAME_DATA |
+           GRC_MODE_WORD_SWAP_NON_FRAME_DATA;
 #else
-    Value32 = GRC_MODE_BYTE_SWAP_NON_FRAME_DATA | GRC_MODE_BYTE_SWAP_DATA;
+       Value32 = GRC_MODE_BYTE_SWAP_NON_FRAME_DATA | GRC_MODE_BYTE_SWAP_DATA;
 #endif
-#endif /* !BIG_ENDIAN_PCI */
-
-    REG_WR(pDevice, Grc.Mode, Value32);
-
-    if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700)
-    {
-       REG_WR(pDevice, Grc.LocalCtrl, GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT1 |
-           GRC_MISC_LOCAL_CTRL_GPIO_OE1);
-    }
-    MM_Wait(40);
-
-    /* Enable indirect memory access */
-    REG_WR(pDevice, MemArbiter.Mode, T3_MEM_ARBITER_MODE_ENABLE);
-
-    if (REG_RD(pDevice, PciCfg.ClockCtrl) & T3_PCI_44MHZ_CORE_CLOCK)
-    {
-       REG_WR(pDevice, PciCfg.ClockCtrl, T3_PCI_44MHZ_CORE_CLOCK |
-               T3_PCI_SELECT_ALTERNATE_CLOCK);
-       REG_WR(pDevice, PciCfg.ClockCtrl, T3_PCI_SELECT_ALTERNATE_CLOCK);
-       MM_Wait(40);  /* required delay is 27usec */
-    }
-    REG_WR(pDevice, PciCfg.ClockCtrl, 0);
-    REG_WR(pDevice, PciCfg.MemWindowBaseAddr, 0);
+#endif                         /* !BIG_ENDIAN_PCI */
+
+       REG_WR (pDevice, Grc.Mode, Value32);
+
+       if (T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5700) {
+               REG_WR (pDevice, Grc.LocalCtrl,
+                       GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT1 |
+                       GRC_MISC_LOCAL_CTRL_GPIO_OE1);
+       }
+       MM_Wait (40);
+
+       /* Enable indirect memory access */
+       REG_WR (pDevice, MemArbiter.Mode, T3_MEM_ARBITER_MODE_ENABLE);
+
+       if (REG_RD (pDevice, PciCfg.ClockCtrl) & T3_PCI_44MHZ_CORE_CLOCK) {
+               REG_WR (pDevice, PciCfg.ClockCtrl, T3_PCI_44MHZ_CORE_CLOCK |
+                       T3_PCI_SELECT_ALTERNATE_CLOCK);
+               REG_WR (pDevice, PciCfg.ClockCtrl,
+                       T3_PCI_SELECT_ALTERNATE_CLOCK);
+               MM_Wait (40);   /* required delay is 27usec */
+       }
+       REG_WR (pDevice, PciCfg.ClockCtrl, 0);
+       REG_WR (pDevice, PciCfg.MemWindowBaseAddr, 0);
 
 #if PCIX_TARGET_WORKAROUND
-    MM_ReadConfig32(pDevice, T3_PCI_STATE_REG, &Value32);
-    if ((pDevice->EnablePciXFix == FALSE) &&
-       ((Value32 & T3_PCI_STATE_CONVENTIONAL_PCI_MODE) == 0))
-    {
-       if (pDevice->ChipRevId == T3_CHIP_ID_5701_A0 ||
-           pDevice->ChipRevId == T3_CHIP_ID_5701_B0 ||
-           pDevice->ChipRevId == T3_CHIP_ID_5701_B2 ||
-           pDevice->ChipRevId == T3_CHIP_ID_5701_B5)
-       {
-           __raw_writel(0, &(pDevice->pMemView->uIntMem.MemBlock32K[0x300]));
-           __raw_writel(0, &(pDevice->pMemView->uIntMem.MemBlock32K[0x301]));
-           __raw_writel(0xffffffff, &(pDevice->pMemView->uIntMem.MemBlock32K[0x301]));
-           if (__raw_readl(&(pDevice->pMemView->uIntMem.MemBlock32K[0x300])))
-           {
-               pDevice->EnablePciXFix = TRUE;
-           }
+       MM_ReadConfig32 (pDevice, T3_PCI_STATE_REG, &Value32);
+       if ((pDevice->EnablePciXFix == FALSE) &&
+           ((Value32 & T3_PCI_STATE_CONVENTIONAL_PCI_MODE) == 0)) {
+               if (pDevice->ChipRevId == T3_CHIP_ID_5701_A0 ||
+                   pDevice->ChipRevId == T3_CHIP_ID_5701_B0 ||
+                   pDevice->ChipRevId == T3_CHIP_ID_5701_B2 ||
+                   pDevice->ChipRevId == T3_CHIP_ID_5701_B5) {
+                       __raw_writel (0,
+                                     &(pDevice->pMemView->uIntMem.
+                                       MemBlock32K[0x300]));
+                       __raw_writel (0,
+                                     &(pDevice->pMemView->uIntMem.
+                                       MemBlock32K[0x301]));
+                       __raw_writel (0xffffffff,
+                                     &(pDevice->pMemView->uIntMem.
+                                       MemBlock32K[0x301]));
+                       if (__raw_readl
+                           (&(pDevice->pMemView->uIntMem.MemBlock32K[0x300])))
+                       {
+                               pDevice->EnablePciXFix = TRUE;
+                       }
+               }
        }
-    }
 #endif
 #if 1
-    /*
-    *  This code was at the beginning of else block below, but that's
-    *  a bug if node address in shared memory.
-    */
-    MM_Wait(50);
-    LM_NvramInit(pDevice);
+       /*
+        *  This code was at the beginning of else block below, but that's
+        *  a bug if node address in shared memory.
+        */
+       MM_Wait (50);
+       LM_NvramInit (pDevice);
 #endif
-    /* Get the node address.  First try to get in from the shared memory. */
-    /* If the signature is not present, then get it from the NVRAM. */
-    Value32 = MEM_RD_OFFSET(pDevice, T3_MAC_ADDR_HIGH_MAILBOX);
-    if((Value32 >> 16) == 0x484b)
-    {
-
-       pDevice->NodeAddress[0] = (LM_UINT8) (Value32 >> 8);
-       pDevice->NodeAddress[1] = (LM_UINT8) Value32;
-
-       Value32 = MEM_RD_OFFSET(pDevice, T3_MAC_ADDR_LOW_MAILBOX);
-
-       pDevice->NodeAddress[2] = (LM_UINT8) (Value32 >> 24);
-       pDevice->NodeAddress[3] = (LM_UINT8) (Value32 >> 16);
-       pDevice->NodeAddress[4] = (LM_UINT8) (Value32 >> 8);
-       pDevice->NodeAddress[5] = (LM_UINT8) Value32;
-
-       Status = LM_STATUS_SUCCESS;
-    }
-    else
-    {
-       Status = LM_NvramRead(pDevice, 0x7c, &Value32);
-       if(Status == LM_STATUS_SUCCESS)
-       {
-           pDevice->NodeAddress[0] = (LM_UINT8) (Value32 >> 16);
-           pDevice->NodeAddress[1] = (LM_UINT8) (Value32 >> 24);
-
-           Status = LM_NvramRead(pDevice, 0x80, &Value32);
-
-           pDevice->NodeAddress[2] = (LM_UINT8) Value32;
-           pDevice->NodeAddress[3] = (LM_UINT8) (Value32 >> 8);
-           pDevice->NodeAddress[4] = (LM_UINT8) (Value32 >> 16);
-           pDevice->NodeAddress[5] = (LM_UINT8) (Value32 >> 24);
+       /* Get the node address.  First try to get in from the shared memory. */
+       /* If the signature is not present, then get it from the NVRAM. */
+       Value32 = MEM_RD_OFFSET (pDevice, T3_MAC_ADDR_HIGH_MAILBOX);
+       if ((Value32 >> 16) == 0x484b) {
+
+               pDevice->NodeAddress[0] = (LM_UINT8) (Value32 >> 8);
+               pDevice->NodeAddress[1] = (LM_UINT8) Value32;
+
+               Value32 = MEM_RD_OFFSET (pDevice, T3_MAC_ADDR_LOW_MAILBOX);
+
+               pDevice->NodeAddress[2] = (LM_UINT8) (Value32 >> 24);
+               pDevice->NodeAddress[3] = (LM_UINT8) (Value32 >> 16);
+               pDevice->NodeAddress[4] = (LM_UINT8) (Value32 >> 8);
+               pDevice->NodeAddress[5] = (LM_UINT8) Value32;
+
+               Status = LM_STATUS_SUCCESS;
+       } else {
+               Status = LM_NvramRead (pDevice, 0x7c, &Value32);
+               if (Status == LM_STATUS_SUCCESS) {
+                       pDevice->NodeAddress[0] = (LM_UINT8) (Value32 >> 16);
+                       pDevice->NodeAddress[1] = (LM_UINT8) (Value32 >> 24);
+
+                       Status = LM_NvramRead (pDevice, 0x80, &Value32);
+
+                       pDevice->NodeAddress[2] = (LM_UINT8) Value32;
+                       pDevice->NodeAddress[3] = (LM_UINT8) (Value32 >> 8);
+                       pDevice->NodeAddress[4] = (LM_UINT8) (Value32 >> 16);
+                       pDevice->NodeAddress[5] = (LM_UINT8) (Value32 >> 24);
+               }
        }
-    }
 
-    /* Assign a default address. */
-    if(Status != LM_STATUS_SUCCESS)
-    {
+       /* Assign a default address. */
+       if (Status != LM_STATUS_SUCCESS) {
 #ifndef EMBEDDED
-       printk(KERN_ERR "Cannot get MAC addr from NVRAM. Using default.\n");
-#endif
-       pDevice->NodeAddress[0] = 0x00; pDevice->NodeAddress[1] = 0x10;
-       pDevice->NodeAddress[2] = 0x18; pDevice->NodeAddress[3] = 0x68;
-       pDevice->NodeAddress[4] = 0x61; pDevice->NodeAddress[5] = 0x76;
-    }
-
-    pDevice->PermanentNodeAddress[0] = pDevice->NodeAddress[0];
-    pDevice->PermanentNodeAddress[1] = pDevice->NodeAddress[1];
-    pDevice->PermanentNodeAddress[2] = pDevice->NodeAddress[2];
-    pDevice->PermanentNodeAddress[3] = pDevice->NodeAddress[3];
-    pDevice->PermanentNodeAddress[4] = pDevice->NodeAddress[4];
-    pDevice->PermanentNodeAddress[5] = pDevice->NodeAddress[5];
-
-    /* Initialize the default values. */
-    pDevice->NoTxPseudoHdrChksum = FALSE;
-    pDevice->NoRxPseudoHdrChksum = FALSE;
-    pDevice->NicSendBd = FALSE;
-    pDevice->TxPacketDescCnt = DEFAULT_TX_PACKET_DESC_COUNT;
-    pDevice->RxStdDescCnt = DEFAULT_STD_RCV_DESC_COUNT;
-    pDevice->RxCoalescingTicks = DEFAULT_RX_COALESCING_TICKS;
-    pDevice->TxCoalescingTicks = DEFAULT_TX_COALESCING_TICKS;
-    pDevice->RxMaxCoalescedFrames = DEFAULT_RX_MAX_COALESCED_FRAMES;
-    pDevice->TxMaxCoalescedFrames = DEFAULT_TX_MAX_COALESCED_FRAMES;
-    pDevice->RxCoalescingTicksDuringInt = BAD_DEFAULT_VALUE;
-    pDevice->TxCoalescingTicksDuringInt = BAD_DEFAULT_VALUE;
-    pDevice->RxMaxCoalescedFramesDuringInt = BAD_DEFAULT_VALUE;
-    pDevice->TxMaxCoalescedFramesDuringInt = BAD_DEFAULT_VALUE;
-    pDevice->StatsCoalescingTicks = DEFAULT_STATS_COALESCING_TICKS;
-    pDevice->EnableMWI = FALSE;
-    pDevice->TxMtu = MAX_ETHERNET_PACKET_SIZE_NO_CRC;
-    pDevice->RxMtu = MAX_ETHERNET_PACKET_SIZE_NO_CRC;
-    pDevice->DisableAutoNeg = FALSE;
-    pDevice->PhyIntMode = T3_PHY_INT_MODE_AUTO;
-    pDevice->LinkChngMode = T3_LINK_CHNG_MODE_AUTO;
-    pDevice->LedMode = LED_MODE_AUTO;
-    pDevice->ResetPhyOnInit = TRUE;
-    pDevice->DelayPciGrant = TRUE;
-    pDevice->UseTaggedStatus = FALSE;
-    pDevice->OneDmaAtOnce = BAD_DEFAULT_VALUE;
-
-    pDevice->DmaMbufLowMark = T3_DEF_DMA_MBUF_LOW_WMARK_JUMBO;
-    pDevice->RxMacMbufLowMark = T3_DEF_RX_MAC_MBUF_LOW_WMARK_JUMBO;
-    pDevice->MbufHighMark = T3_DEF_MBUF_HIGH_WMARK_JUMBO;
-
-    pDevice->RequestedMediaType = LM_REQUESTED_MEDIA_TYPE_AUTO;
-    pDevice->TaskOffloadCap = LM_TASK_OFFLOAD_NONE;
-    pDevice->FlowControlCap = LM_FLOW_CONTROL_AUTO_PAUSE;
-    pDevice->EnableTbi = FALSE;
-#if INCLUDE_TBI_SUPPORT
-    pDevice->PollTbiLink = BAD_DEFAULT_VALUE;
+               printk (KERN_ERR
+                       "Cannot get MAC addr from NVRAM. Using default.\n");
 #endif
+               pDevice->NodeAddress[0] = 0x00;
+               pDevice->NodeAddress[1] = 0x10;
+               pDevice->NodeAddress[2] = 0x18;
+               pDevice->NodeAddress[3] = 0x68;
+               pDevice->NodeAddress[4] = 0x61;
+               pDevice->NodeAddress[5] = 0x76;
+       }
+
+       pDevice->PermanentNodeAddress[0] = pDevice->NodeAddress[0];
+       pDevice->PermanentNodeAddress[1] = pDevice->NodeAddress[1];
+       pDevice->PermanentNodeAddress[2] = pDevice->NodeAddress[2];
+       pDevice->PermanentNodeAddress[3] = pDevice->NodeAddress[3];
+       pDevice->PermanentNodeAddress[4] = pDevice->NodeAddress[4];
+       pDevice->PermanentNodeAddress[5] = pDevice->NodeAddress[5];
+
+       /* Initialize the default values. */
+       pDevice->NoTxPseudoHdrChksum = FALSE;
+       pDevice->NoRxPseudoHdrChksum = FALSE;
+       pDevice->NicSendBd = FALSE;
+       pDevice->TxPacketDescCnt = DEFAULT_TX_PACKET_DESC_COUNT;
+       pDevice->RxStdDescCnt = DEFAULT_STD_RCV_DESC_COUNT;
+       pDevice->RxCoalescingTicks = DEFAULT_RX_COALESCING_TICKS;
+       pDevice->TxCoalescingTicks = DEFAULT_TX_COALESCING_TICKS;
+       pDevice->RxMaxCoalescedFrames = DEFAULT_RX_MAX_COALESCED_FRAMES;
+       pDevice->TxMaxCoalescedFrames = DEFAULT_TX_MAX_COALESCED_FRAMES;
+       pDevice->RxCoalescingTicksDuringInt = BAD_DEFAULT_VALUE;
+       pDevice->TxCoalescingTicksDuringInt = BAD_DEFAULT_VALUE;
+       pDevice->RxMaxCoalescedFramesDuringInt = BAD_DEFAULT_VALUE;
+       pDevice->TxMaxCoalescedFramesDuringInt = BAD_DEFAULT_VALUE;
+       pDevice->StatsCoalescingTicks = DEFAULT_STATS_COALESCING_TICKS;
+       pDevice->EnableMWI = FALSE;
+       pDevice->TxMtu = MAX_ETHERNET_PACKET_SIZE_NO_CRC;
+       pDevice->RxMtu = MAX_ETHERNET_PACKET_SIZE_NO_CRC;
+       pDevice->DisableAutoNeg = FALSE;
+       pDevice->PhyIntMode = T3_PHY_INT_MODE_AUTO;
+       pDevice->LinkChngMode = T3_LINK_CHNG_MODE_AUTO;
+       pDevice->LedMode = LED_MODE_AUTO;
+       pDevice->ResetPhyOnInit = TRUE;
+       pDevice->DelayPciGrant = TRUE;
+       pDevice->UseTaggedStatus = FALSE;
+       pDevice->OneDmaAtOnce = BAD_DEFAULT_VALUE;
 
-    switch (T3_ASIC_REV(pDevice->ChipRevId))
-    {
-    case T3_ASIC_REV_5704:
-       pDevice->MbufBase = T3_NIC_MBUF_POOL_ADDR;
-       pDevice->MbufSize = T3_NIC_MBUF_POOL_SIZE64;
-       break;
-    default:
-       pDevice->MbufBase = T3_NIC_MBUF_POOL_ADDR;
-       pDevice->MbufSize = T3_NIC_MBUF_POOL_SIZE96;
-       break;
-    }
-
-    pDevice->LinkStatus = LM_STATUS_LINK_DOWN;
-    pDevice->QueueRxPackets = TRUE;
-
-    pDevice->EnableWireSpeed = TRUE;
+       pDevice->DmaMbufLowMark = T3_DEF_DMA_MBUF_LOW_WMARK_JUMBO;
+       pDevice->RxMacMbufLowMark = T3_DEF_RX_MAC_MBUF_LOW_WMARK_JUMBO;
+       pDevice->MbufHighMark = T3_DEF_MBUF_HIGH_WMARK_JUMBO;
 
-#if T3_JUMBO_RCV_RCB_ENTRY_COUNT
-    pDevice->RxJumboDescCnt = DEFAULT_JUMBO_RCV_DESC_COUNT;
-#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
-
-    /* Make this is a known adapter. */
-    pAdapterInfo = LM_GetAdapterInfoBySsid(pDevice->SubsystemVendorId,
-       pDevice->SubsystemId);
-
-    pDevice->BondId = REG_RD(pDevice, Grc.MiscCfg) & GRC_MISC_BD_ID_MASK;
-    if (pDevice->BondId != GRC_MISC_BD_ID_5700 &&
-       pDevice->BondId != GRC_MISC_BD_ID_5701 &&
-       pDevice->BondId != GRC_MISC_BD_ID_5702FE &&
-       pDevice->BondId != GRC_MISC_BD_ID_5703 &&
-       pDevice->BondId != GRC_MISC_BD_ID_5703S &&
-       pDevice->BondId != GRC_MISC_BD_ID_5704 &&
-       pDevice->BondId != GRC_MISC_BD_ID_5704CIOBE)
-    {
-       return LM_STATUS_UNKNOWN_ADAPTER;
-    }
-
-    pDevice->SplitModeEnable = SPLIT_MODE_DISABLE;
-    if ((pDevice->ChipRevId == T3_CHIP_ID_5704_A0) &&
-       (pDevice->BondId == GRC_MISC_BD_ID_5704CIOBE))
-    {
-       pDevice->SplitModeEnable = SPLIT_MODE_ENABLE;
-       pDevice->SplitModeMaxReq = SPLIT_MODE_5704_MAX_REQ;
-    }
-
-    /* Get Eeprom info. */
-    Value32 = MEM_RD_OFFSET(pDevice, T3_NIC_DATA_SIG_ADDR);
-    if (Value32 == T3_NIC_DATA_SIG)
-    {
-       EeSigFound = TRUE;
-       Value32 = MEM_RD_OFFSET(pDevice, T3_NIC_DATA_NIC_CFG_ADDR);
-
-       /* Determine PHY type. */
-       switch (Value32 & T3_NIC_CFG_PHY_TYPE_MASK)
-       {
-           case T3_NIC_CFG_PHY_TYPE_COPPER:
-               EePhyTypeSerdes = FALSE;
-               break;
+       pDevice->RequestedMediaType = LM_REQUESTED_MEDIA_TYPE_AUTO;
+       pDevice->TaskOffloadCap = LM_TASK_OFFLOAD_NONE;
+       pDevice->FlowControlCap = LM_FLOW_CONTROL_AUTO_PAUSE;
+       pDevice->EnableTbi = FALSE;
+#if INCLUDE_TBI_SUPPORT
+       pDevice->PollTbiLink = BAD_DEFAULT_VALUE;
+#endif
 
-           case T3_NIC_CFG_PHY_TYPE_FIBER:
-               EePhyTypeSerdes = TRUE;
+       switch (T3_ASIC_REV (pDevice->ChipRevId)) {
+       case T3_ASIC_REV_5704:
+               pDevice->MbufBase = T3_NIC_MBUF_POOL_ADDR;
+               pDevice->MbufSize = T3_NIC_MBUF_POOL_SIZE64;
                break;
-
-           default:
-               EePhyTypeSerdes = FALSE;
+       default:
+               pDevice->MbufBase = T3_NIC_MBUF_POOL_ADDR;
+               pDevice->MbufSize = T3_NIC_MBUF_POOL_SIZE96;
                break;
        }
 
-       /* Determine PHY led mode. */
-       if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 ||
-           T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701)
-       {
-           switch(Value32 & T3_NIC_CFG_LED_MODE_MASK)
-           {
-               case T3_NIC_CFG_LED_MODE_TRIPLE_SPEED:
-                   EePhyLedMode = LED_MODE_THREE_LINK;
-                   break;
+       pDevice->LinkStatus = LM_STATUS_LINK_DOWN;
+       pDevice->QueueRxPackets = TRUE;
 
-               case T3_NIC_CFG_LED_MODE_LINK_SPEED:
-                   EePhyLedMode = LED_MODE_LINK10;
-                   break;
+       pDevice->EnableWireSpeed = TRUE;
 
-               default:
-                   EePhyLedMode = LED_MODE_AUTO;
-                   break;
-           }
-       }
-       else
-       {
-           switch(Value32 & T3_NIC_CFG_LED_MODE_MASK)
-           {
-               case T3_NIC_CFG_LED_MODE_OPEN_DRAIN:
-                   EePhyLedMode = LED_MODE_OPEN_DRAIN;
-                   break;
+#if T3_JUMBO_RCV_RCB_ENTRY_COUNT
+       pDevice->RxJumboDescCnt = DEFAULT_JUMBO_RCV_DESC_COUNT;
+#endif                         /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
+
+       /* Make this is a known adapter. */
+       pAdapterInfo = LM_GetAdapterInfoBySsid (pDevice->SubsystemVendorId,
+                                               pDevice->SubsystemId);
+
+       pDevice->BondId = REG_RD (pDevice, Grc.MiscCfg) & GRC_MISC_BD_ID_MASK;
+       if (pDevice->BondId != GRC_MISC_BD_ID_5700 &&
+           pDevice->BondId != GRC_MISC_BD_ID_5701 &&
+           pDevice->BondId != GRC_MISC_BD_ID_5702FE &&
+           pDevice->BondId != GRC_MISC_BD_ID_5703 &&
+           pDevice->BondId != GRC_MISC_BD_ID_5703S &&
+           pDevice->BondId != GRC_MISC_BD_ID_5704 &&
+           pDevice->BondId != GRC_MISC_BD_ID_5704CIOBE) {
+               return LM_STATUS_UNKNOWN_ADAPTER;
+       }
+
+       pDevice->SplitModeEnable = SPLIT_MODE_DISABLE;
+       if ((pDevice->ChipRevId == T3_CHIP_ID_5704_A0) &&
+           (pDevice->BondId == GRC_MISC_BD_ID_5704CIOBE)) {
+               pDevice->SplitModeEnable = SPLIT_MODE_ENABLE;
+               pDevice->SplitModeMaxReq = SPLIT_MODE_5704_MAX_REQ;
+       }
+
+       /* Get Eeprom info. */
+       Value32 = MEM_RD_OFFSET (pDevice, T3_NIC_DATA_SIG_ADDR);
+       if (Value32 == T3_NIC_DATA_SIG) {
+               EeSigFound = TRUE;
+               Value32 = MEM_RD_OFFSET (pDevice, T3_NIC_DATA_NIC_CFG_ADDR);
+
+               /* Determine PHY type. */
+               switch (Value32 & T3_NIC_CFG_PHY_TYPE_MASK) {
+               case T3_NIC_CFG_PHY_TYPE_COPPER:
+                       EePhyTypeSerdes = FALSE;
+                       break;
 
-               case T3_NIC_CFG_LED_MODE_OUTPUT:
-                   EePhyLedMode = LED_MODE_OUTPUT;
-                   break;
+               case T3_NIC_CFG_PHY_TYPE_FIBER:
+                       EePhyTypeSerdes = TRUE;
+                       break;
 
                default:
-                   EePhyLedMode = LED_MODE_AUTO;
-                   break;
-           }
-       }
-       if(pDevice->ChipRevId == T3_CHIP_ID_5703_A1 ||
-           pDevice->ChipRevId == T3_CHIP_ID_5703_A2)
-       {
-           /* Enable EEPROM write protection. */
-           if(Value32 & T3_NIC_EEPROM_WP)
-           {
-               pDevice->EepromWp = TRUE;
-           }
-       }
+                       EePhyTypeSerdes = FALSE;
+                       break;
+               }
 
-       /* Get the PHY Id. */
-       Value32 = MEM_RD_OFFSET(pDevice, T3_NIC_DATA_PHY_ID_ADDR);
-       if (Value32)
-       {
-           EePhyId = (((Value32 & T3_NIC_PHY_ID1_MASK) >> 16) &
-               PHY_ID1_OUI_MASK) << 10;
+               /* Determine PHY led mode. */
+               if (T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5700 ||
+                   T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5701) {
+                       switch (Value32 & T3_NIC_CFG_LED_MODE_MASK) {
+                       case T3_NIC_CFG_LED_MODE_TRIPLE_SPEED:
+                               EePhyLedMode = LED_MODE_THREE_LINK;
+                               break;
+
+                       case T3_NIC_CFG_LED_MODE_LINK_SPEED:
+                               EePhyLedMode = LED_MODE_LINK10;
+                               break;
+
+                       default:
+                               EePhyLedMode = LED_MODE_AUTO;
+                               break;
+                       }
+               } else {
+                       switch (Value32 & T3_NIC_CFG_LED_MODE_MASK) {
+                       case T3_NIC_CFG_LED_MODE_OPEN_DRAIN:
+                               EePhyLedMode = LED_MODE_OPEN_DRAIN;
+                               break;
+
+                       case T3_NIC_CFG_LED_MODE_OUTPUT:
+                               EePhyLedMode = LED_MODE_OUTPUT;
+                               break;
+
+                       default:
+                               EePhyLedMode = LED_MODE_AUTO;
+                               break;
+                       }
+               }
+               if (pDevice->ChipRevId == T3_CHIP_ID_5703_A1 ||
+                   pDevice->ChipRevId == T3_CHIP_ID_5703_A2) {
+                       /* Enable EEPROM write protection. */
+                       if (Value32 & T3_NIC_EEPROM_WP) {
+                               pDevice->EepromWp = TRUE;
+                       }
+               }
 
-           Value32 = Value32 & T3_NIC_PHY_ID2_MASK;
+               /* Get the PHY Id. */
+               Value32 = MEM_RD_OFFSET (pDevice, T3_NIC_DATA_PHY_ID_ADDR);
+               if (Value32) {
+                       EePhyId = (((Value32 & T3_NIC_PHY_ID1_MASK) >> 16) &
+                                  PHY_ID1_OUI_MASK) << 10;
 
-           EePhyId |= ((Value32 & PHY_ID2_OUI_MASK) << 16) |
-             (Value32 & PHY_ID2_MODEL_MASK) | (Value32 & PHY_ID2_REV_MASK);
-       }
-       else
-       {
-           EePhyId = 0;
+                       Value32 = Value32 & T3_NIC_PHY_ID2_MASK;
+
+                       EePhyId |= ((Value32 & PHY_ID2_OUI_MASK) << 16) |
+                           (Value32 & PHY_ID2_MODEL_MASK) | (Value32 &
+                                                             PHY_ID2_REV_MASK);
+               } else {
+                       EePhyId = 0;
+               }
+       } else {
+               EeSigFound = FALSE;
        }
-    }
-    else
-    {
-       EeSigFound = FALSE;
-    }
 
-    /* Set the PHY address. */
-    pDevice->PhyAddr = PHY_DEVICE_ID;
+       /* Set the PHY address. */
+       pDevice->PhyAddr = PHY_DEVICE_ID;
 
-    /* Disable auto polling. */
-    pDevice->MiMode = 0xc0000;
-    REG_WR(pDevice, MacCtrl.MiMode, pDevice->MiMode);
-    MM_Wait(40);
+       /* Disable auto polling. */
+       pDevice->MiMode = 0xc0000;
+       REG_WR (pDevice, MacCtrl.MiMode, pDevice->MiMode);
+       MM_Wait (40);
 
-    /* Get the PHY id. */
-    LM_ReadPhy(pDevice, PHY_ID1_REG, &Value32);
-    pDevice->PhyId = (Value32 & PHY_ID1_OUI_MASK) << 10;
+       /* Get the PHY id. */
+       LM_ReadPhy (pDevice, PHY_ID1_REG, &Value32);
+       pDevice->PhyId = (Value32 & PHY_ID1_OUI_MASK) << 10;
 
-    LM_ReadPhy(pDevice, PHY_ID2_REG, &Value32);
-    pDevice->PhyId |= ((Value32 & PHY_ID2_OUI_MASK) << 16) |
-      (Value32 & PHY_ID2_MODEL_MASK) | (Value32 & PHY_ID2_REV_MASK);
+       LM_ReadPhy (pDevice, PHY_ID2_REG, &Value32);
+       pDevice->PhyId |= ((Value32 & PHY_ID2_OUI_MASK) << 16) |
+           (Value32 & PHY_ID2_MODEL_MASK) | (Value32 & PHY_ID2_REV_MASK);
 
-    /* Set the EnableTbi flag to false if we have a copper PHY. */
-    switch(pDevice->PhyId & PHY_ID_MASK)
-    {
+       /* Set the EnableTbi flag to false if we have a copper PHY. */
+       switch (pDevice->PhyId & PHY_ID_MASK) {
        case PHY_BCM5400_PHY_ID:
-           pDevice->EnableTbi = FALSE;
-           break;
+               pDevice->EnableTbi = FALSE;
+               break;
 
        case PHY_BCM5401_PHY_ID:
-           pDevice->EnableTbi = FALSE;
-           break;
+               pDevice->EnableTbi = FALSE;
+               break;
 
        case PHY_BCM5411_PHY_ID:
-           pDevice->EnableTbi = FALSE;
-           break;
+               pDevice->EnableTbi = FALSE;
+               break;
 
        case PHY_BCM5701_PHY_ID:
-           pDevice->EnableTbi = FALSE;
-           break;
+               pDevice->EnableTbi = FALSE;
+               break;
 
        case PHY_BCM5703_PHY_ID:
-           pDevice->EnableTbi = FALSE;
-           break;
+               pDevice->EnableTbi = FALSE;
+               break;
 
        case PHY_BCM5704_PHY_ID:
-           pDevice->EnableTbi = FALSE;
-           break;
+               pDevice->EnableTbi = FALSE;
+               break;
 
        case PHY_BCM8002_PHY_ID:
-           pDevice->EnableTbi = TRUE;
-           break;
+               pDevice->EnableTbi = TRUE;
+               break;
 
        default:
 
-           if (pAdapterInfo)
-           {
-               pDevice->PhyId = pAdapterInfo->PhyId;
-               pDevice->EnableTbi = pAdapterInfo->Serdes;
-           }
-           else if (EeSigFound)
-           {
-               pDevice->PhyId = EePhyId;
-               pDevice->EnableTbi = EePhyTypeSerdes;
-           }
-           break;
-    }
-
-    /* Bail out if we don't know the copper PHY id. */
-    if(UNKNOWN_PHY_ID(pDevice->PhyId) && !pDevice->EnableTbi)
-    {
-       return LM_STATUS_FAILURE;
-    }
+               if (pAdapterInfo) {
+                       pDevice->PhyId = pAdapterInfo->PhyId;
+                       pDevice->EnableTbi = pAdapterInfo->Serdes;
+               } else if (EeSigFound) {
+                       pDevice->PhyId = EePhyId;
+                       pDevice->EnableTbi = EePhyTypeSerdes;
+               }
+               break;
+       }
 
-    if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5703)
-    {
-       if((pDevice->SavedCacheLineReg & 0xff00) < 0x4000)
-       {
-           pDevice->SavedCacheLineReg &= 0xffff00ff;
-           pDevice->SavedCacheLineReg |= 0x4000;
-       }
-    }
-    /* Change driver parameters. */
-    Status = MM_GetConfig(pDevice);
-    if(Status != LM_STATUS_SUCCESS)
-    {
-       return Status;
-    }
+       /* Bail out if we don't know the copper PHY id. */
+       if (UNKNOWN_PHY_ID (pDevice->PhyId) && !pDevice->EnableTbi) {
+               return LM_STATUS_FAILURE;
+       }
 
+       if (T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5703) {
+               if ((pDevice->SavedCacheLineReg & 0xff00) < 0x4000) {
+                       pDevice->SavedCacheLineReg &= 0xffff00ff;
+                       pDevice->SavedCacheLineReg |= 0x4000;
+               }
+       }
+       /* Change driver parameters. */
+       Status = MM_GetConfig (pDevice);
+       if (Status != LM_STATUS_SUCCESS) {
+               return Status;
+       }
 #if INCLUDE_5701_AX_FIX
-    if (pDevice->ChipRevId == T3_CHIP_ID_5701_A0 ||
-       pDevice->ChipRevId == T3_CHIP_ID_5701_B0)
-    {
-       pDevice->ResetPhyOnInit = TRUE;
-    }
+       if (pDevice->ChipRevId == T3_CHIP_ID_5701_A0 ||
+           pDevice->ChipRevId == T3_CHIP_ID_5701_B0) {
+               pDevice->ResetPhyOnInit = TRUE;
+       }
 #endif
 
-    /* Save the current phy link status. */
-    if(!pDevice->EnableTbi)
-    {
-       LM_ReadPhy(pDevice, PHY_STATUS_REG, &Value32);
-       LM_ReadPhy(pDevice, PHY_STATUS_REG, &Value32);
-
-       /* If we don't have link reset the PHY. */
-       if(!(Value32 & PHY_STATUS_LINK_PASS) || pDevice->ResetPhyOnInit)
-       {
+       /* Save the current phy link status. */
+       if (!pDevice->EnableTbi) {
+               LM_ReadPhy (pDevice, PHY_STATUS_REG, &Value32);
+               LM_ReadPhy (pDevice, PHY_STATUS_REG, &Value32);
 
-           LM_WritePhy(pDevice, PHY_CTRL_REG, PHY_CTRL_PHY_RESET);
+               /* If we don't have link reset the PHY. */
+               if (!(Value32 & PHY_STATUS_LINK_PASS)
+                   || pDevice->ResetPhyOnInit) {
 
-           for(j = 0; j < 100; j++)
-           {
-               MM_Wait(10);
+                       LM_WritePhy (pDevice, PHY_CTRL_REG, PHY_CTRL_PHY_RESET);
 
-               LM_ReadPhy(pDevice, PHY_CTRL_REG, &Value32);
-               if(Value32 && !(Value32 & PHY_CTRL_PHY_RESET))
-               {
-                   MM_Wait(40);
-                   break;
-               }
-           }
+                       for (j = 0; j < 100; j++) {
+                               MM_Wait (10);
 
+                               LM_ReadPhy (pDevice, PHY_CTRL_REG, &Value32);
+                               if (Value32 && !(Value32 & PHY_CTRL_PHY_RESET)) {
+                                       MM_Wait (40);
+                                       break;
+                               }
+                       }
 
 #if INCLUDE_5701_AX_FIX
-           /* 5701_AX_BX bug:  only advertises 10mb speed. */
-           if(pDevice->ChipRevId == T3_CHIP_ID_5701_A0 ||
-               pDevice->ChipRevId == T3_CHIP_ID_5701_B0)
-           {
-
-               Value32 = PHY_AN_AD_PROTOCOL_802_3_CSMA_CD |
-                   PHY_AN_AD_10BASET_HALF | PHY_AN_AD_10BASET_FULL |
-                   PHY_AN_AD_100BASETX_FULL | PHY_AN_AD_100BASETX_HALF;
-               Value32 |= GetPhyAdFlowCntrlSettings(pDevice);
-               LM_WritePhy(pDevice, PHY_AN_AD_REG, Value32);
-               pDevice->advertising = Value32;
-
-               Value32 = BCM540X_AN_AD_1000BASET_HALF |
-                   BCM540X_AN_AD_1000BASET_FULL | BCM540X_CONFIG_AS_MASTER |
-                   BCM540X_ENABLE_CONFIG_AS_MASTER;
-               LM_WritePhy(pDevice, BCM540X_1000BASET_CTRL_REG, Value32);
-               pDevice->advertising1000 = Value32;
-
-               LM_WritePhy(pDevice, PHY_CTRL_REG, PHY_CTRL_AUTO_NEG_ENABLE |
-                   PHY_CTRL_RESTART_AUTO_NEG);
-           }
+                       /* 5701_AX_BX bug:  only advertises 10mb speed. */
+                       if (pDevice->ChipRevId == T3_CHIP_ID_5701_A0 ||
+                           pDevice->ChipRevId == T3_CHIP_ID_5701_B0) {
+
+                               Value32 = PHY_AN_AD_PROTOCOL_802_3_CSMA_CD |
+                                   PHY_AN_AD_10BASET_HALF |
+                                   PHY_AN_AD_10BASET_FULL |
+                                   PHY_AN_AD_100BASETX_FULL |
+                                   PHY_AN_AD_100BASETX_HALF;
+                               Value32 |= GetPhyAdFlowCntrlSettings (pDevice);
+                               LM_WritePhy (pDevice, PHY_AN_AD_REG, Value32);
+                               pDevice->advertising = Value32;
+
+                               Value32 = BCM540X_AN_AD_1000BASET_HALF |
+                                   BCM540X_AN_AD_1000BASET_FULL |
+                                   BCM540X_CONFIG_AS_MASTER |
+                                   BCM540X_ENABLE_CONFIG_AS_MASTER;
+                               LM_WritePhy (pDevice,
+                                            BCM540X_1000BASET_CTRL_REG,
+                                            Value32);
+                               pDevice->advertising1000 = Value32;
+
+                               LM_WritePhy (pDevice, PHY_CTRL_REG,
+                                            PHY_CTRL_AUTO_NEG_ENABLE |
+                                            PHY_CTRL_RESTART_AUTO_NEG);
+                       }
 #endif
-           if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5703)
-           {
-               LM_WritePhy(pDevice, 0x18, 0x0c00);
-               LM_WritePhy(pDevice, 0x17, 0x201f);
-               LM_WritePhy(pDevice, 0x15, 0x2aaa);
-           }
-           if(pDevice->ChipRevId == T3_CHIP_ID_5704_A0)
-           {
-               LM_WritePhy(pDevice, 0x1c, 0x8d68);
-               LM_WritePhy(pDevice, 0x1c, 0x8d68);
-           }
-           /* Enable Ethernet@WireSpeed. */
-           if(pDevice->EnableWireSpeed)
-           {
-               LM_WritePhy(pDevice, 0x18, 0x7007);
-               LM_ReadPhy(pDevice, 0x18, &Value32);
-               LM_WritePhy(pDevice, 0x18, Value32 | BIT_15 | BIT_4);
-           }
-       }
-    }
-
-    /* Turn off tap power management. */
-    if((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5401_PHY_ID)
-    {
-       LM_WritePhy(pDevice, BCM5401_AUX_CTRL, 0x0c20);
-       LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x0012);
-       LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x1804);
-       LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x0013);
-       LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x1204);
-       LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x8006);
-       LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x0132);
-       LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x8006);
-       LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x0232);
-       LM_WritePhy(pDevice, BCM540X_DSP_ADDRESS_REG, 0x201f);
-       LM_WritePhy(pDevice, BCM540X_DSP_RW_PORT, 0x0a20);
-
-       MM_Wait(40);
-    }
+                       if (T3_ASIC_REV (pDevice->ChipRevId) ==
+                           T3_ASIC_REV_5703) {
+                               LM_WritePhy (pDevice, 0x18, 0x0c00);
+                               LM_WritePhy (pDevice, 0x17, 0x201f);
+                               LM_WritePhy (pDevice, 0x15, 0x2aaa);
+                       }
+                       if (pDevice->ChipRevId == T3_CHIP_ID_5704_A0) {
+                               LM_WritePhy (pDevice, 0x1c, 0x8d68);
+                               LM_WritePhy (pDevice, 0x1c, 0x8d68);
+                       }
+                       /* Enable Ethernet@WireSpeed. */
+                       if (pDevice->EnableWireSpeed) {
+                               LM_WritePhy (pDevice, 0x18, 0x7007);
+                               LM_ReadPhy (pDevice, 0x18, &Value32);
+                               LM_WritePhy (pDevice, 0x18,
+                                            Value32 | BIT_15 | BIT_4);
+                       }
+               }
+       }
 
-#if INCLUDE_TBI_SUPPORT
-    pDevice->IgnoreTbiLinkChange = FALSE;
-
-    if(pDevice->EnableTbi)
-    {
-       pDevice->WakeUpModeCap = LM_WAKE_UP_MODE_NONE;
-       pDevice->PhyIntMode = T3_PHY_INT_MODE_LINK_READY;
-       if ((pDevice->PollTbiLink == BAD_DEFAULT_VALUE) ||
-           pDevice->DisableAutoNeg)
-       {
-           pDevice->PollTbiLink = FALSE;
-       }
-    }
-    else
-    {
-       pDevice->PollTbiLink = FALSE;
-    }
-#endif /* INCLUDE_TBI_SUPPORT */
-
-    /* UseTaggedStatus is only valid for 5701 and later. */
-    if (T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700)
-    {
-       pDevice->UseTaggedStatus = FALSE;
+       /* Turn off tap power management. */
+       if ((pDevice->PhyId & PHY_ID_MASK) == PHY_BCM5401_PHY_ID) {
+               LM_WritePhy (pDevice, BCM5401_AUX_CTRL, 0x0c20);
+               LM_WritePhy (pDevice, BCM540X_DSP_ADDRESS_REG, 0x0012);
+               LM_WritePhy (pDevice, BCM540X_DSP_RW_PORT, 0x1804);
+               LM_WritePhy (pDevice, BCM540X_DSP_ADDRESS_REG, 0x0013);
+               LM_WritePhy (pDevice, BCM540X_DSP_RW_PORT, 0x1204);
+               LM_WritePhy (pDevice, BCM540X_DSP_ADDRESS_REG, 0x8006);
+               LM_WritePhy (pDevice, BCM540X_DSP_RW_PORT, 0x0132);
+               LM_WritePhy (pDevice, BCM540X_DSP_ADDRESS_REG, 0x8006);
+               LM_WritePhy (pDevice, BCM540X_DSP_RW_PORT, 0x0232);
+               LM_WritePhy (pDevice, BCM540X_DSP_ADDRESS_REG, 0x201f);
+               LM_WritePhy (pDevice, BCM540X_DSP_RW_PORT, 0x0a20);
 
-       pDevice->CoalesceMode = 0;
-    }
-    else
-    {
-       pDevice->CoalesceMode = HOST_COALESCE_CLEAR_TICKS_ON_RX_BD_EVENT |
-           HOST_COALESCE_CLEAR_TICKS_ON_TX_BD_EVENT;
-    }
-
-    /* Set the status block size. */
-    if(T3_CHIP_REV(pDevice->ChipRevId) != T3_CHIP_REV_5700_AX &&
-       T3_CHIP_REV(pDevice->ChipRevId) != T3_CHIP_REV_5700_BX)
-    {
-       pDevice->CoalesceMode |= HOST_COALESCE_32_BYTE_STATUS_MODE;
-    }
-
-    /* Check the DURING_INT coalescing ticks parameters. */
-    if(pDevice->UseTaggedStatus)
-    {
-       if(pDevice->RxCoalescingTicksDuringInt == BAD_DEFAULT_VALUE)
-       {
-           pDevice->RxCoalescingTicksDuringInt =
-               DEFAULT_RX_COALESCING_TICKS_DURING_INT;
+               MM_Wait (40);
        }
-
-       if(pDevice->TxCoalescingTicksDuringInt == BAD_DEFAULT_VALUE)
-       {
-           pDevice->TxCoalescingTicksDuringInt =
-               DEFAULT_TX_COALESCING_TICKS_DURING_INT;
+#if INCLUDE_TBI_SUPPORT
+       pDevice->IgnoreTbiLinkChange = FALSE;
+
+       if (pDevice->EnableTbi) {
+               pDevice->WakeUpModeCap = LM_WAKE_UP_MODE_NONE;
+               pDevice->PhyIntMode = T3_PHY_INT_MODE_LINK_READY;
+               if ((pDevice->PollTbiLink == BAD_DEFAULT_VALUE) ||
+                   pDevice->DisableAutoNeg) {
+                       pDevice->PollTbiLink = FALSE;
+               }
+       } else {
+               pDevice->PollTbiLink = FALSE;
        }
+#endif                         /* INCLUDE_TBI_SUPPORT */
 
-       if(pDevice->RxMaxCoalescedFramesDuringInt == BAD_DEFAULT_VALUE)
-       {
-           pDevice->RxMaxCoalescedFramesDuringInt =
-               DEFAULT_RX_MAX_COALESCED_FRAMES_DURING_INT;
-       }
+       /* UseTaggedStatus is only valid for 5701 and later. */
+       if (T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5700) {
+               pDevice->UseTaggedStatus = FALSE;
 
-       if(pDevice->TxMaxCoalescedFramesDuringInt == BAD_DEFAULT_VALUE)
-       {
-           pDevice->TxMaxCoalescedFramesDuringInt =
-               DEFAULT_TX_MAX_COALESCED_FRAMES_DURING_INT;
-       }
-    }
-    else
-    {
-       if(pDevice->RxCoalescingTicksDuringInt == BAD_DEFAULT_VALUE)
-       {
-           pDevice->RxCoalescingTicksDuringInt = 0;
+               pDevice->CoalesceMode = 0;
+       } else {
+               pDevice->CoalesceMode =
+                   HOST_COALESCE_CLEAR_TICKS_ON_RX_BD_EVENT |
+                   HOST_COALESCE_CLEAR_TICKS_ON_TX_BD_EVENT;
        }
 
-       if(pDevice->TxCoalescingTicksDuringInt == BAD_DEFAULT_VALUE)
-       {
-           pDevice->TxCoalescingTicksDuringInt = 0;
+       /* Set the status block size. */
+       if (T3_CHIP_REV (pDevice->ChipRevId) != T3_CHIP_REV_5700_AX &&
+           T3_CHIP_REV (pDevice->ChipRevId) != T3_CHIP_REV_5700_BX) {
+               pDevice->CoalesceMode |= HOST_COALESCE_32_BYTE_STATUS_MODE;
        }
 
-       if(pDevice->RxMaxCoalescedFramesDuringInt == BAD_DEFAULT_VALUE)
-       {
-           pDevice->RxMaxCoalescedFramesDuringInt = 0;
-       }
+       /* Check the DURING_INT coalescing ticks parameters. */
+       if (pDevice->UseTaggedStatus) {
+               if (pDevice->RxCoalescingTicksDuringInt == BAD_DEFAULT_VALUE) {
+                       pDevice->RxCoalescingTicksDuringInt =
+                           DEFAULT_RX_COALESCING_TICKS_DURING_INT;
+               }
 
-       if(pDevice->TxMaxCoalescedFramesDuringInt == BAD_DEFAULT_VALUE)
-       {
-           pDevice->TxMaxCoalescedFramesDuringInt = 0;
-       }
-    }
+               if (pDevice->TxCoalescingTicksDuringInt == BAD_DEFAULT_VALUE) {
+                       pDevice->TxCoalescingTicksDuringInt =
+                           DEFAULT_TX_COALESCING_TICKS_DURING_INT;
+               }
 
-#if T3_JUMBO_RCV_RCB_ENTRY_COUNT
-    if(pDevice->RxMtu <= (MAX_STD_RCV_BUFFER_SIZE - 8 /* CRC */))
-    {
-       pDevice->RxJumboDescCnt = 0;
-       if(pDevice->RxMtu <= MAX_ETHERNET_PACKET_SIZE_NO_CRC)
-       {
-           pDevice->RxMtu = MAX_ETHERNET_PACKET_SIZE_NO_CRC;
-       }
-    }
-    else
-    {
-       pDevice->RxJumboBufferSize = (pDevice->RxMtu + 8 /* CRC + VLAN */ +
-           COMMON_CACHE_LINE_SIZE-1) & ~COMMON_CACHE_LINE_MASK;
+               if (pDevice->RxMaxCoalescedFramesDuringInt == BAD_DEFAULT_VALUE) {
+                       pDevice->RxMaxCoalescedFramesDuringInt =
+                           DEFAULT_RX_MAX_COALESCED_FRAMES_DURING_INT;
+               }
 
-       if(pDevice->RxJumboBufferSize > MAX_JUMBO_RCV_BUFFER_SIZE)
-       {
-           pDevice->RxJumboBufferSize = DEFAULT_JUMBO_RCV_BUFFER_SIZE;
-           pDevice->RxMtu = pDevice->RxJumboBufferSize - 8 /* CRC + VLAN */;
-       }
-       pDevice->TxMtu = pDevice->RxMtu;
+               if (pDevice->TxMaxCoalescedFramesDuringInt == BAD_DEFAULT_VALUE) {
+                       pDevice->TxMaxCoalescedFramesDuringInt =
+                           DEFAULT_TX_MAX_COALESCED_FRAMES_DURING_INT;
+               }
+       } else {
+               if (pDevice->RxCoalescingTicksDuringInt == BAD_DEFAULT_VALUE) {
+                       pDevice->RxCoalescingTicksDuringInt = 0;
+               }
 
-    }
-#else
-    pDevice->RxMtu = MAX_ETHERNET_PACKET_SIZE_NO_CRC;
-#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
+               if (pDevice->TxCoalescingTicksDuringInt == BAD_DEFAULT_VALUE) {
+                       pDevice->TxCoalescingTicksDuringInt = 0;
+               }
+
+               if (pDevice->RxMaxCoalescedFramesDuringInt == BAD_DEFAULT_VALUE) {
+                       pDevice->RxMaxCoalescedFramesDuringInt = 0;
+               }
+
+               if (pDevice->TxMaxCoalescedFramesDuringInt == BAD_DEFAULT_VALUE) {
+                       pDevice->TxMaxCoalescedFramesDuringInt = 0;
+               }
+       }
 
-    pDevice->RxPacketDescCnt =
 #if T3_JUMBO_RCV_RCB_ENTRY_COUNT
-       pDevice->RxJumboDescCnt +
-#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
-       pDevice->RxStdDescCnt;
+       if (pDevice->RxMtu <= (MAX_STD_RCV_BUFFER_SIZE - 8 /* CRC */ )) {
+               pDevice->RxJumboDescCnt = 0;
+               if (pDevice->RxMtu <= MAX_ETHERNET_PACKET_SIZE_NO_CRC) {
+                       pDevice->RxMtu = MAX_ETHERNET_PACKET_SIZE_NO_CRC;
+               }
+       } else {
+               pDevice->RxJumboBufferSize =
+                   (pDevice->RxMtu + 8 /* CRC + VLAN */  +
+                    COMMON_CACHE_LINE_SIZE - 1) & ~COMMON_CACHE_LINE_MASK;
+
+               if (pDevice->RxJumboBufferSize > MAX_JUMBO_RCV_BUFFER_SIZE) {
+                       pDevice->RxJumboBufferSize =
+                           DEFAULT_JUMBO_RCV_BUFFER_SIZE;
+                       pDevice->RxMtu =
+                           pDevice->RxJumboBufferSize - 8 /* CRC + VLAN */ ;
+               }
+               pDevice->TxMtu = pDevice->RxMtu;
 
-    if(pDevice->TxMtu < MAX_ETHERNET_PACKET_SIZE_NO_CRC)
-    {
-       pDevice->TxMtu = MAX_ETHERNET_PACKET_SIZE_NO_CRC;
-    }
+       }
+#else
+       pDevice->RxMtu = MAX_ETHERNET_PACKET_SIZE_NO_CRC;
+#endif                         /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
 
-    if(pDevice->TxMtu > MAX_JUMBO_TX_BUFFER_SIZE)
-    {
-       pDevice->TxMtu = MAX_JUMBO_TX_BUFFER_SIZE;
-    }
+       pDevice->RxPacketDescCnt =
+#if T3_JUMBO_RCV_RCB_ENTRY_COUNT
+           pDevice->RxJumboDescCnt +
+#endif                         /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
+           pDevice->RxStdDescCnt;
 
-    /* Configure the proper ways to get link change interrupt. */
-    if(pDevice->PhyIntMode == T3_PHY_INT_MODE_AUTO)
-    {
-       if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700)
-       {
-           pDevice->PhyIntMode = T3_PHY_INT_MODE_MI_INTERRUPT;
+       if (pDevice->TxMtu < MAX_ETHERNET_PACKET_SIZE_NO_CRC) {
+               pDevice->TxMtu = MAX_ETHERNET_PACKET_SIZE_NO_CRC;
        }
-       else
-       {
-           pDevice->PhyIntMode = T3_PHY_INT_MODE_LINK_READY;
+
+       if (pDevice->TxMtu > MAX_JUMBO_TX_BUFFER_SIZE) {
+               pDevice->TxMtu = MAX_JUMBO_TX_BUFFER_SIZE;
        }
-    }
-    else if(pDevice->PhyIntMode == T3_PHY_INT_MODE_AUTO_POLLING)
-    {
-       /* Auto-polling does not work on 5700_AX and 5700_BX. */
-       if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700)
-       {
-           pDevice->PhyIntMode = T3_PHY_INT_MODE_MI_INTERRUPT;
+
+       /* Configure the proper ways to get link change interrupt. */
+       if (pDevice->PhyIntMode == T3_PHY_INT_MODE_AUTO) {
+               if (T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5700) {
+                       pDevice->PhyIntMode = T3_PHY_INT_MODE_MI_INTERRUPT;
+               } else {
+                       pDevice->PhyIntMode = T3_PHY_INT_MODE_LINK_READY;
+               }
+       } else if (pDevice->PhyIntMode == T3_PHY_INT_MODE_AUTO_POLLING) {
+               /* Auto-polling does not work on 5700_AX and 5700_BX. */
+               if (T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5700) {
+                       pDevice->PhyIntMode = T3_PHY_INT_MODE_MI_INTERRUPT;
+               }
        }
-    }
 
-    /* Determine the method to get link change status. */
-    if(pDevice->LinkChngMode == T3_LINK_CHNG_MODE_AUTO)
-    {
-       /* The link status bit in the status block does not work on 5700_AX */
-       /* and 5700_BX chips. */
-       if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700)
-       {
-           pDevice->LinkChngMode = T3_LINK_CHNG_MODE_USE_STATUS_REG;
+       /* Determine the method to get link change status. */
+       if (pDevice->LinkChngMode == T3_LINK_CHNG_MODE_AUTO) {
+               /* The link status bit in the status block does not work on 5700_AX */
+               /* and 5700_BX chips. */
+               if (T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5700) {
+                       pDevice->LinkChngMode =
+                           T3_LINK_CHNG_MODE_USE_STATUS_REG;
+               } else {
+                       pDevice->LinkChngMode =
+                           T3_LINK_CHNG_MODE_USE_STATUS_BLOCK;
+               }
        }
-       else
-       {
-           pDevice->LinkChngMode = T3_LINK_CHNG_MODE_USE_STATUS_BLOCK;
+
+       if (pDevice->PhyIntMode == T3_PHY_INT_MODE_MI_INTERRUPT ||
+           T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5700) {
+               pDevice->LinkChngMode = T3_LINK_CHNG_MODE_USE_STATUS_REG;
        }
-    }
 
-    if(pDevice->PhyIntMode == T3_PHY_INT_MODE_MI_INTERRUPT ||
-       T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700)
-    {
-       pDevice->LinkChngMode = T3_LINK_CHNG_MODE_USE_STATUS_REG;
-    }
+       /* Configure PHY led mode. */
+       if (pDevice->LedMode == LED_MODE_AUTO) {
+               if (T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5700 ||
+                   T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5701) {
+                       if (pDevice->SubsystemVendorId == T3_SVID_DELL) {
+                               pDevice->LedMode = LED_MODE_LINK10;
+                       } else {
+                               pDevice->LedMode = LED_MODE_THREE_LINK;
 
-    /* Configure PHY led mode. */
-    if(pDevice->LedMode == LED_MODE_AUTO)
-    {
-       if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 ||
-           T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5701)
-       {
-           if(pDevice->SubsystemVendorId == T3_SVID_DELL)
-           {
-               pDevice->LedMode = LED_MODE_LINK10;
-           }
-           else
-           {
-               pDevice->LedMode = LED_MODE_THREE_LINK;
-
-               if(EeSigFound && EePhyLedMode != LED_MODE_AUTO)
-               {
-                   pDevice->LedMode = EePhyLedMode;
-               }
-           }
-
-           /* bug? 5701 in LINK10 mode does not seem to work when */
-           /* PhyIntMode is LINK_READY. */
-           if(T3_ASIC_REV(pDevice->ChipRevId) != T3_ASIC_REV_5700 &&
+                               if (EeSigFound && EePhyLedMode != LED_MODE_AUTO) {
+                                       pDevice->LedMode = EePhyLedMode;
+                               }
+                       }
+
+                       /* bug? 5701 in LINK10 mode does not seem to work when */
+                       /* PhyIntMode is LINK_READY. */
+                       if (T3_ASIC_REV (pDevice->ChipRevId) != T3_ASIC_REV_5700
+                           &&
 #if INCLUDE_TBI_SUPPORT
-               pDevice->EnableTbi == FALSE &&
+                           pDevice->EnableTbi == FALSE &&
 #endif
-               pDevice->LedMode == LED_MODE_LINK10)
-           {
-               pDevice->PhyIntMode = T3_PHY_INT_MODE_MI_INTERRUPT;
-               pDevice->LinkChngMode = T3_LINK_CHNG_MODE_USE_STATUS_REG;
-           }
+                           pDevice->LedMode == LED_MODE_LINK10) {
+                               pDevice->PhyIntMode =
+                                   T3_PHY_INT_MODE_MI_INTERRUPT;
+                               pDevice->LinkChngMode =
+                                   T3_LINK_CHNG_MODE_USE_STATUS_REG;
+                       }
+
+                       if (pDevice->EnableTbi) {
+                               pDevice->LedMode = LED_MODE_THREE_LINK;
+                       }
+               } else {
+                       if (EeSigFound && EePhyLedMode != LED_MODE_AUTO) {
+                               pDevice->LedMode = EePhyLedMode;
+                       } else {
+                               pDevice->LedMode = LED_MODE_OPEN_DRAIN;
+                       }
+               }
+       }
 
-           if(pDevice->EnableTbi)
-           {
-               pDevice->LedMode = LED_MODE_THREE_LINK;
-           }
+       /* Enable OneDmaAtOnce. */
+       if (pDevice->OneDmaAtOnce == BAD_DEFAULT_VALUE) {
+               pDevice->OneDmaAtOnce = FALSE;
        }
-       else
-       {
-           if(EeSigFound && EePhyLedMode != LED_MODE_AUTO)
-           {
-               pDevice->LedMode = EePhyLedMode;
-           }
-           else
-           {
-               pDevice->LedMode = LED_MODE_OPEN_DRAIN;
-           }
-       }
-    }
-
-    /* Enable OneDmaAtOnce. */
-    if(pDevice->OneDmaAtOnce == BAD_DEFAULT_VALUE)
-    {
-       pDevice->OneDmaAtOnce = FALSE;
-    }
-
-    if (T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5700 ||
-       pDevice->ChipRevId == T3_CHIP_ID_5701_A0 ||
-       pDevice->ChipRevId == T3_CHIP_ID_5701_B0 ||
-       pDevice->ChipRevId == T3_CHIP_ID_5701_B2)
-    {
-       pDevice->WolSpeed = WOL_SPEED_10MB;
-    }
-    else
-    {
-       pDevice->WolSpeed = WOL_SPEED_100MB;
-    }
-
-    /* Offloadings. */
-    pDevice->TaskToOffload = LM_TASK_OFFLOAD_NONE;
-
-    /* Turn off task offloading on Ax. */
-    if(pDevice->ChipRevId == T3_CHIP_ID_5700_B0)
-    {
-       pDevice->TaskOffloadCap &= ~(LM_TASK_OFFLOAD_TX_TCP_CHECKSUM |
-           LM_TASK_OFFLOAD_TX_UDP_CHECKSUM);
-    }
-    pDevice->PciState = REG_RD(pDevice, PciCfg.PciState);
-    LM_ReadVPD(pDevice);
-    LM_ReadBootCodeVersion(pDevice);
-    LM_GetBusSpeed(pDevice);
-
-    return LM_STATUS_SUCCESS;
-} /* LM_GetAdapterInfo */
-
-STATIC PLM_ADAPTER_INFO
-LM_GetAdapterInfoBySsid(
-    LM_UINT16 Svid,
-    LM_UINT16 Ssid)
+
+       if (T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5700 ||
+           pDevice->ChipRevId == T3_CHIP_ID_5701_A0 ||
+           pDevice->ChipRevId == T3_CHIP_ID_5701_B0 ||
+           pDevice->ChipRevId == T3_CHIP_ID_5701_B2) {
+               pDevice->WolSpeed = WOL_SPEED_10MB;
+       } else {
+               pDevice->WolSpeed = WOL_SPEED_100MB;
+       }
+
+       /* Offloadings. */
+       pDevice->TaskToOffload = LM_TASK_OFFLOAD_NONE;
+
+       /* Turn off task offloading on Ax. */
+       if (pDevice->ChipRevId == T3_CHIP_ID_5700_B0) {
+               pDevice->TaskOffloadCap &= ~(LM_TASK_OFFLOAD_TX_TCP_CHECKSUM |
+                                            LM_TASK_OFFLOAD_TX_UDP_CHECKSUM);
+       }
+       pDevice->PciState = REG_RD (pDevice, PciCfg.PciState);
+       LM_ReadVPD (pDevice);
+       LM_ReadBootCodeVersion (pDevice);
+       LM_GetBusSpeed (pDevice);
+
+       return LM_STATUS_SUCCESS;
+}                              /* LM_GetAdapterInfo */
+
+STATIC PLM_ADAPTER_INFO LM_GetAdapterInfoBySsid (LM_UINT16 Svid, LM_UINT16 Ssid)
 {
-    static LM_ADAPTER_INFO AdapterArr[] =
-    {
-       { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95700A6, PHY_BCM5401_PHY_ID, 0},
-       { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701A5, PHY_BCM5701_PHY_ID, 0},
-       { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95700T6, PHY_BCM8002_PHY_ID, 1},
-       { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95700A9, 0, 1 },
-       { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701T1, PHY_BCM5701_PHY_ID, 0},
-       { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701T8, PHY_BCM5701_PHY_ID, 0},
-       { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701A7, 0, 1},
-       { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701A10, PHY_BCM5701_PHY_ID, 0},
-       { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701A12, PHY_BCM5701_PHY_ID, 0},
-       { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95703Ax1, PHY_BCM5701_PHY_ID, 0},
-       { T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95703Ax2, PHY_BCM5701_PHY_ID, 0},
-
-       { T3_SVID_3COM, T3_SSID_3COM_3C996T, PHY_BCM5401_PHY_ID, 0 },
-       { T3_SVID_3COM, T3_SSID_3COM_3C996BT, PHY_BCM5701_PHY_ID, 0 },
-       { T3_SVID_3COM, T3_SSID_3COM_3C996SX, 0, 1 },
-       { T3_SVID_3COM, T3_SSID_3COM_3C1000T, PHY_BCM5701_PHY_ID, 0 },
-       { T3_SVID_3COM, T3_SSID_3COM_3C940BR01, PHY_BCM5701_PHY_ID, 0 },
-
-       { T3_SVID_DELL, T3_SSID_DELL_VIPER, PHY_BCM5401_PHY_ID, 0 },
-       { T3_SVID_DELL, T3_SSID_DELL_JAGUAR, PHY_BCM5401_PHY_ID, 0 },
-       { T3_SVID_DELL, T3_SSID_DELL_MERLOT, PHY_BCM5411_PHY_ID, 0 },
-       { T3_SVID_DELL, T3_SSID_DELL_SLIM_MERLOT, PHY_BCM5411_PHY_ID, 0 },
-
-       { T3_SVID_COMPAQ, T3_SSID_COMPAQ_BANSHEE, PHY_BCM5701_PHY_ID, 0 },
-       { T3_SVID_COMPAQ, T3_SSID_COMPAQ_BANSHEE_2, PHY_BCM5701_PHY_ID, 0 },
-       { T3_SVID_COMPAQ, T3_SSID_COMPAQ_CHANGELING, 0, 1 },
-       { T3_SVID_COMPAQ, T3_SSID_COMPAQ_NC7780, PHY_BCM5701_PHY_ID, 0 },
-       { T3_SVID_COMPAQ, T3_SSID_COMPAQ_NC7780_2, PHY_BCM5701_PHY_ID, 0 },
-
-    };
-    LM_UINT32 j;
-
-    for(j = 0; j < sizeof(AdapterArr)/sizeof(LM_ADAPTER_INFO); j++)
-    {
-       if(AdapterArr[j].Svid == Svid && AdapterArr[j].Ssid == Ssid)
-       {
-           return &AdapterArr[j];
+       static LM_ADAPTER_INFO AdapterArr[] = {
+               {T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95700A6,
+                PHY_BCM5401_PHY_ID, 0},
+               {T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701A5,
+                PHY_BCM5701_PHY_ID, 0},
+               {T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95700T6,
+                PHY_BCM8002_PHY_ID, 1},
+               {T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95700A9, 0, 1},
+               {T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701T1,
+                PHY_BCM5701_PHY_ID, 0},
+               {T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701T8,
+                PHY_BCM5701_PHY_ID, 0},
+               {T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701A7, 0, 1},
+               {T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701A10,
+                PHY_BCM5701_PHY_ID, 0},
+               {T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95701A12,
+                PHY_BCM5701_PHY_ID, 0},
+               {T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95703Ax1,
+                PHY_BCM5701_PHY_ID, 0},
+               {T3_SVID_BROADCOM, T3_SSID_BROADCOM_BCM95703Ax2,
+                PHY_BCM5701_PHY_ID, 0},
+
+               {T3_SVID_3COM, T3_SSID_3COM_3C996T, PHY_BCM5401_PHY_ID, 0},
+               {T3_SVID_3COM, T3_SSID_3COM_3C996BT, PHY_BCM5701_PHY_ID, 0},
+               {T3_SVID_3COM, T3_SSID_3COM_3C996SX, 0, 1},
+               {T3_SVID_3COM, T3_SSID_3COM_3C1000T, PHY_BCM5701_PHY_ID, 0},
+               {T3_SVID_3COM, T3_SSID_3COM_3C940BR01, PHY_BCM5701_PHY_ID, 0},
+
+               {T3_SVID_DELL, T3_SSID_DELL_VIPER, PHY_BCM5401_PHY_ID, 0},
+               {T3_SVID_DELL, T3_SSID_DELL_JAGUAR, PHY_BCM5401_PHY_ID, 0},
+               {T3_SVID_DELL, T3_SSID_DELL_MERLOT, PHY_BCM5411_PHY_ID, 0},
+               {T3_SVID_DELL, T3_SSID_DELL_SLIM_MERLOT, PHY_BCM5411_PHY_ID, 0},
+
+               {T3_SVID_COMPAQ, T3_SSID_COMPAQ_BANSHEE, PHY_BCM5701_PHY_ID, 0},
+               {T3_SVID_COMPAQ, T3_SSID_COMPAQ_BANSHEE_2, PHY_BCM5701_PHY_ID,
+                0},
+               {T3_SVID_COMPAQ, T3_SSID_COMPAQ_CHANGELING, 0, 1},
+               {T3_SVID_COMPAQ, T3_SSID_COMPAQ_NC7780, PHY_BCM5701_PHY_ID, 0},
+               {T3_SVID_COMPAQ, T3_SSID_COMPAQ_NC7780_2, PHY_BCM5701_PHY_ID,
+                0},
+
+       };
+       LM_UINT32 j;
+
+       for (j = 0; j < sizeof (AdapterArr) / sizeof (LM_ADAPTER_INFO); j++) {
+               if (AdapterArr[j].Svid == Svid && AdapterArr[j].Ssid == Ssid) {
+                       return &AdapterArr[j];
+               }
        }
-    }
 
-    return NULL;
+       return NULL;
 }
 
-
 /******************************************************************************/
 /* Description:                                                               */
 /*    This routine sets up receive/transmit buffer descriptions queues.       */
@@ -1638,237 +1489,226 @@ LM_GetAdapterInfoBySsid(
 /* Return:                                                                    */
 /*    LM_STATUS_SUCCESS                                                       */
 /******************************************************************************/
-LM_STATUS
-LM_InitializeAdapter(
-PLM_DEVICE_BLOCK pDevice)
+LM_STATUS LM_InitializeAdapter (PLM_DEVICE_BLOCK pDevice)
 {
-    LM_PHYSICAL_ADDRESS MemPhy;
-    PLM_UINT8 pMemVirt;
-    PLM_PACKET pPacket;
-    LM_STATUS Status;
-    LM_UINT32 Size;
-    LM_UINT32 j;
-
-    /* Set power state to D0. */
-    LM_SetPowerState(pDevice, LM_POWER_STATE_D0);
-
-    /* Intialize the queues. */
-    QQ_InitQueue(&pDevice->RxPacketReceivedQ.Container,
-       MAX_RX_PACKET_DESC_COUNT);
-    QQ_InitQueue(&pDevice->RxPacketFreeQ.Container,
-       MAX_RX_PACKET_DESC_COUNT);
-
-    QQ_InitQueue(&pDevice->TxPacketFreeQ.Container,MAX_TX_PACKET_DESC_COUNT);
-    QQ_InitQueue(&pDevice->TxPacketActiveQ.Container,MAX_TX_PACKET_DESC_COUNT);
-    QQ_InitQueue(&pDevice->TxPacketXmittedQ.Container,MAX_TX_PACKET_DESC_COUNT);
-
-    /* Allocate shared memory for: status block, the buffers for receive */
-    /* rings -- standard, mini, jumbo, and return rings. */
-    Size = T3_STATUS_BLOCK_SIZE + sizeof(T3_STATS_BLOCK) +
-       T3_STD_RCV_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD) +
+       LM_PHYSICAL_ADDRESS MemPhy;
+       PLM_UINT8 pMemVirt;
+       PLM_PACKET pPacket;
+       LM_STATUS Status;
+       LM_UINT32 Size;
+       LM_UINT32 j;
+
+       /* Set power state to D0. */
+       LM_SetPowerState (pDevice, LM_POWER_STATE_D0);
+
+       /* Intialize the queues. */
+       QQ_InitQueue (&pDevice->RxPacketReceivedQ.Container,
+                     MAX_RX_PACKET_DESC_COUNT);
+       QQ_InitQueue (&pDevice->RxPacketFreeQ.Container,
+                     MAX_RX_PACKET_DESC_COUNT);
+
+       QQ_InitQueue (&pDevice->TxPacketFreeQ.Container,
+                     MAX_TX_PACKET_DESC_COUNT);
+       QQ_InitQueue (&pDevice->TxPacketActiveQ.Container,
+                     MAX_TX_PACKET_DESC_COUNT);
+       QQ_InitQueue (&pDevice->TxPacketXmittedQ.Container,
+                     MAX_TX_PACKET_DESC_COUNT);
+
+       /* Allocate shared memory for: status block, the buffers for receive */
+       /* rings -- standard, mini, jumbo, and return rings. */
+       Size = T3_STATUS_BLOCK_SIZE + sizeof (T3_STATS_BLOCK) +
+           T3_STD_RCV_RCB_ENTRY_COUNT * sizeof (T3_RCV_BD) +
 #if T3_JUMBO_RCV_RCB_ENTRY_COUNT
-       T3_JUMBO_RCV_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD) +
-#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
-       T3_RCV_RETURN_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD);
-
-    /* Memory for host based Send BD. */
-    if(pDevice->NicSendBd == FALSE)
-    {
-       Size += sizeof(T3_SND_BD) * T3_SEND_RCB_ENTRY_COUNT;
-    }
-
-    /* Allocate the memory block. */
-    Status = MM_AllocateSharedMemory(pDevice, Size, (PLM_VOID) &pMemVirt, &MemPhy, FALSE);
-    if(Status != LM_STATUS_SUCCESS)
-    {
-       return Status;
-    }
-
-    /* Program DMA Read/Write */
-    if (pDevice->PciState & T3_PCI_STATE_NOT_PCI_X_BUS)
-    {
-       pDevice->DmaReadWriteCtrl = 0x763f000f;
-    }
-    else
-    {
-       if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5704)
-       {
-           pDevice->DmaReadWriteCtrl = 0x761f0000;
+           T3_JUMBO_RCV_RCB_ENTRY_COUNT * sizeof (T3_RCV_BD) +
+#endif                         /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
+           T3_RCV_RETURN_RCB_ENTRY_COUNT * sizeof (T3_RCV_BD);
+
+       /* Memory for host based Send BD. */
+       if (pDevice->NicSendBd == FALSE) {
+               Size += sizeof (T3_SND_BD) * T3_SEND_RCB_ENTRY_COUNT;
+       }
+
+       /* Allocate the memory block. */
+       Status =
+           MM_AllocateSharedMemory (pDevice, Size, (PLM_VOID) & pMemVirt,
+                                    &MemPhy, FALSE);
+       if (Status != LM_STATUS_SUCCESS) {
+               return Status;
+       }
+
+       /* Program DMA Read/Write */
+       if (pDevice->PciState & T3_PCI_STATE_NOT_PCI_X_BUS) {
+               pDevice->DmaReadWriteCtrl = 0x763f000f;
+       } else {
+               if (T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5704) {
+                       pDevice->DmaReadWriteCtrl = 0x761f0000;
+               } else {
+                       pDevice->DmaReadWriteCtrl = 0x761b000f;
+               }
+               if (pDevice->ChipRevId == T3_CHIP_ID_5703_A1 ||
+                   pDevice->ChipRevId == T3_CHIP_ID_5703_A2) {
+                       pDevice->OneDmaAtOnce = TRUE;
+               }
        }
-       else
-       {
-           pDevice->DmaReadWriteCtrl = 0x761b000f;
+       if (T3_ASIC_REV (pDevice->ChipRevId) == T3_ASIC_REV_5703) {
+               pDevice->DmaReadWriteCtrl &= 0xfffffff0;
+       }
+
+       if (pDevice->OneDmaAtOnce) {
+               pDevice->DmaReadWriteCtrl |= DMA_CTRL_WRITE_ONE_DMA_AT_ONCE;
+       }
+       REG_WR (pDevice, PciCfg.DmaReadWriteCtrl, pDevice->DmaReadWriteCtrl);
+
+       if (LM_DmaTest (pDevice, pMemVirt, MemPhy, 0x400) != LM_STATUS_SUCCESS) {
+               return LM_STATUS_FAILURE;
        }
-       if(pDevice->ChipRevId == T3_CHIP_ID_5703_A1 ||
-           pDevice->ChipRevId == T3_CHIP_ID_5703_A2)
-       {
-           pDevice->OneDmaAtOnce = TRUE;
-       }
-    }
-    if(T3_ASIC_REV(pDevice->ChipRevId) == T3_ASIC_REV_5703)
-    {
-       pDevice->DmaReadWriteCtrl &= 0xfffffff0;
-    }
-
-    if(pDevice->OneDmaAtOnce)
-    {
-       pDevice->DmaReadWriteCtrl |= DMA_CTRL_WRITE_ONE_DMA_AT_ONCE;
-    }
-    REG_WR(pDevice, PciCfg.DmaReadWriteCtrl, pDevice->DmaReadWriteCtrl);
-
-    if (LM_DmaTest(pDevice, pMemVirt, MemPhy, 0x400) != LM_STATUS_SUCCESS)
-    {
-       return LM_STATUS_FAILURE;
-    }
 
-    /* Status block. */
-    pDevice->pStatusBlkVirt = (PT3_STATUS_BLOCK) pMemVirt;
-    pDevice->StatusBlkPhy = MemPhy;
-    pMemVirt += T3_STATUS_BLOCK_SIZE;
-    LM_INC_PHYSICAL_ADDRESS(&MemPhy, T3_STATUS_BLOCK_SIZE);
+       /* Status block. */
+       pDevice->pStatusBlkVirt = (PT3_STATUS_BLOCK) pMemVirt;
+       pDevice->StatusBlkPhy = MemPhy;
+       pMemVirt += T3_STATUS_BLOCK_SIZE;
+       LM_INC_PHYSICAL_ADDRESS (&MemPhy, T3_STATUS_BLOCK_SIZE);
 
-    /* Statistics block. */
-    pDevice->pStatsBlkVirt = (PT3_STATS_BLOCK) pMemVirt;
-    pDevice->StatsBlkPhy = MemPhy;
-    pMemVirt += sizeof(T3_STATS_BLOCK);
-    LM_INC_PHYSICAL_ADDRESS(&MemPhy, sizeof(T3_STATS_BLOCK));
+       /* Statistics block. */
+       pDevice->pStatsBlkVirt = (PT3_STATS_BLOCK) pMemVirt;
+       pDevice->StatsBlkPhy = MemPhy;
+       pMemVirt += sizeof (T3_STATS_BLOCK);
+       LM_INC_PHYSICAL_ADDRESS (&MemPhy, sizeof (T3_STATS_BLOCK));
 
-    /* Receive standard BD buffer. */
-    pDevice->pRxStdBdVirt = (PT3_RCV_BD) pMemVirt;
-    pDevice->RxStdBdPhy = MemPhy;
+       /* Receive standard BD buffer. */
+       pDevice->pRxStdBdVirt = (PT3_RCV_BD) pMemVirt;
+       pDevice->RxStdBdPhy = MemPhy;
 
-    pMemVirt += T3_STD_RCV_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD);
-    LM_INC_PHYSICAL_ADDRESS(&MemPhy,
-       T3_STD_RCV_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD));
+       pMemVirt += T3_STD_RCV_RCB_ENTRY_COUNT * sizeof (T3_RCV_BD);
+       LM_INC_PHYSICAL_ADDRESS (&MemPhy,
+                                T3_STD_RCV_RCB_ENTRY_COUNT *
+                                sizeof (T3_RCV_BD));
 
 #if T3_JUMBO_RCV_RCB_ENTRY_COUNT
-    /* Receive jumbo BD buffer. */
-    pDevice->pRxJumboBdVirt = (PT3_RCV_BD) pMemVirt;
-    pDevice->RxJumboBdPhy = MemPhy;
-
-    pMemVirt += T3_JUMBO_RCV_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD);
-    LM_INC_PHYSICAL_ADDRESS(&MemPhy,
-       T3_JUMBO_RCV_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD));
-#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
-
-    /* Receive return BD buffer. */
-    pDevice->pRcvRetBdVirt = (PT3_RCV_BD) pMemVirt;
-    pDevice->RcvRetBdPhy = MemPhy;
-
-    pMemVirt += T3_RCV_RETURN_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD);
-    LM_INC_PHYSICAL_ADDRESS(&MemPhy,
-       T3_RCV_RETURN_RCB_ENTRY_COUNT * sizeof(T3_RCV_BD));
-
-    /* Set up Send BD. */
-    if(pDevice->NicSendBd == FALSE)
-    {
-       pDevice->pSendBdVirt = (PT3_SND_BD) pMemVirt;
-       pDevice->SendBdPhy = MemPhy;
-
-       pMemVirt += sizeof(T3_SND_BD) * T3_SEND_RCB_ENTRY_COUNT;
-       LM_INC_PHYSICAL_ADDRESS(&MemPhy,
-           sizeof(T3_SND_BD) * T3_SEND_RCB_ENTRY_COUNT);
-    }
-    else
-    {
-       pDevice->pSendBdVirt = (PT3_SND_BD)
-           pDevice->pMemView->uIntMem.First32k.BufferDesc;
-       pDevice->SendBdPhy.High = 0;
-       pDevice->SendBdPhy.Low = T3_NIC_SND_BUFFER_DESC_ADDR;
-    }
-
-    /* Allocate memory for packet descriptors. */
-    Size = (pDevice->RxPacketDescCnt +
-       pDevice->TxPacketDescCnt) * MM_PACKET_DESC_SIZE;
-    Status = MM_AllocateMemory(pDevice, Size, (PLM_VOID *) &pPacket);
-    if(Status != LM_STATUS_SUCCESS)
-    {
-       return Status;
-    }
-    pDevice->pPacketDescBase = (PLM_VOID) pPacket;
-
-    /* Create transmit packet descriptors from the memory block and add them */
-    /* to the TxPacketFreeQ for each send ring. */
-    for(j = 0; j < pDevice->TxPacketDescCnt; j++)
-    {
-       /* Ring index. */
-       pPacket->Flags = 0;
-
-       /* Queue the descriptor in the TxPacketFreeQ of the 'k' ring. */
-       QQ_PushTail(&pDevice->TxPacketFreeQ.Container, pPacket);
-
-       /* Get the pointer to the next descriptor.  MM_PACKET_DESC_SIZE */
-       /* is the total size of the packet descriptor including the */
-       /* os-specific extensions in the UM_PACKET structure. */
-       pPacket = (PLM_PACKET) ((PLM_UINT8) pPacket + MM_PACKET_DESC_SIZE);
-    } /* for(j.. */
-
-    /* Create receive packet descriptors from the memory block and add them */
-    /* to the RxPacketFreeQ.  Create the Standard packet descriptors. */
-    for(j = 0; j < pDevice->RxStdDescCnt; j++)
-    {
-       /* Receive producer ring. */
-       pPacket->u.Rx.RcvProdRing = T3_STD_RCV_PROD_RING;
-
-       /* Receive buffer size. */
-       pPacket->u.Rx.RxBufferSize = MAX_STD_RCV_BUFFER_SIZE;
-
-       /* Add the descriptor to RxPacketFreeQ. */
-       QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket);
-
-       /* Get the pointer to the next descriptor.  MM_PACKET_DESC_SIZE */
-       /* is the total size of the packet descriptor including the */
-       /* os-specific extensions in the UM_PACKET structure. */
-       pPacket = (PLM_PACKET) ((PLM_UINT8) pPacket + MM_PACKET_DESC_SIZE);
-    } /* for */
+       /* Receive jumbo BD buffer. */
+       pDevice->pRxJumboBdVirt = (PT3_RCV_BD) pMemVirt;
+       pDevice->RxJumboBdPhy = MemPhy;
+
+       pMemVirt += T3_JUMBO_RCV_RCB_ENTRY_COUNT * sizeof (T3_RCV_BD);
+       LM_INC_PHYSICAL_ADDRESS (&MemPhy,
+                                T3_JUMBO_RCV_RCB_ENTRY_COUNT *
+                                sizeof (T3_RCV_BD));
+#endif                         /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
+
+       /* Receive return BD buffer. */
+       pDevice->pRcvRetBdVirt = (PT3_RCV_BD) pMemVirt;
+       pDevice->RcvRetBdPhy = MemPhy;
+
+       pMemVirt += T3_RCV_RETURN_RCB_ENTRY_COUNT * sizeof (T3_RCV_BD);
+       LM_INC_PHYSICAL_ADDRESS (&MemPhy,
+                                T3_RCV_RETURN_RCB_ENTRY_COUNT *
+                                sizeof (T3_RCV_BD));
+
+       /* Set up Send BD. */
+       if (pDevice->NicSendBd == FALSE) {
+               pDevice->pSendBdVirt = (PT3_SND_BD) pMemVirt;
+               pDevice->SendBdPhy = MemPhy;
+
+               pMemVirt += sizeof (T3_SND_BD) * T3_SEND_RCB_ENTRY_COUNT;
+               LM_INC_PHYSICAL_ADDRESS (&MemPhy,
+                                        sizeof (T3_SND_BD) *
+                                        T3_SEND_RCB_ENTRY_COUNT);
+       } else {
+               pDevice->pSendBdVirt = (PT3_SND_BD)
+                   pDevice->pMemView->uIntMem.First32k.BufferDesc;
+               pDevice->SendBdPhy.High = 0;
+               pDevice->SendBdPhy.Low = T3_NIC_SND_BUFFER_DESC_ADDR;
+       }
+
+       /* Allocate memory for packet descriptors. */
+       Size = (pDevice->RxPacketDescCnt +
+               pDevice->TxPacketDescCnt) * MM_PACKET_DESC_SIZE;
+       Status = MM_AllocateMemory (pDevice, Size, (PLM_VOID *) & pPacket);
+       if (Status != LM_STATUS_SUCCESS) {
+               return Status;
+       }
+       pDevice->pPacketDescBase = (PLM_VOID) pPacket;
+
+       /* Create transmit packet descriptors from the memory block and add them */
+       /* to the TxPacketFreeQ for each send ring. */
+       for (j = 0; j < pDevice->TxPacketDescCnt; j++) {
+               /* Ring index. */
+               pPacket->Flags = 0;
+
+               /* Queue the descriptor in the TxPacketFreeQ of the 'k' ring. */
+               QQ_PushTail (&pDevice->TxPacketFreeQ.Container, pPacket);
+
+               /* Get the pointer to the next descriptor.  MM_PACKET_DESC_SIZE */
+               /* is the total size of the packet descriptor including the */
+               /* os-specific extensions in the UM_PACKET structure. */
+               pPacket =
+                   (PLM_PACKET) ((PLM_UINT8) pPacket + MM_PACKET_DESC_SIZE);
+       }                       /* for(j.. */
+
+       /* Create receive packet descriptors from the memory block and add them */
+       /* to the RxPacketFreeQ.  Create the Standard packet descriptors. */
+       for (j = 0; j < pDevice->RxStdDescCnt; j++) {
+               /* Receive producer ring. */
+               pPacket->u.Rx.RcvProdRing = T3_STD_RCV_PROD_RING;
+
+               /* Receive buffer size. */
+               pPacket->u.Rx.RxBufferSize = MAX_STD_RCV_BUFFER_SIZE;
+
+               /* Add the descriptor to RxPacketFreeQ. */
+               QQ_PushTail (&pDevice->RxPacketFreeQ.Container, pPacket);
+
+               /* Get the pointer to the next descriptor.  MM_PACKET_DESC_SIZE */
+               /* is the total size of the packet descriptor including the */
+               /* os-specific extensions in the UM_PACKET structure. */
+               pPacket =
+                   (PLM_PACKET) ((PLM_UINT8) pPacket + MM_PACKET_DESC_SIZE);
+       }                       /* for */
 
 #if T3_JUMBO_RCV_RCB_ENTRY_COUNT
-    /* Create the Jumbo packet descriptors. */
-    for(j = 0; j < pDevice->RxJumboDescCnt; j++)
-    {
-       /* Receive producer ring. */
-       pPacket->u.Rx.RcvProdRing = T3_JUMBO_RCV_PROD_RING;
-
-       /* Receive buffer size. */
-       pPacket->u.Rx.RxBufferSize = pDevice->RxJumboBufferSize;
-
-       /* Add the descriptor to RxPacketFreeQ. */
-       QQ_PushTail(&pDevice->RxPacketFreeQ.Container, pPacket);
-
-       /* Get the pointer to the next descriptor.  MM_PACKET_DESC_SIZE */
-       /* is the total size of the packet descriptor including the */
-       /* os-specific extensions in the UM_PACKET structure. */
-       pPacket = (PLM_PACKET) ((PLM_UINT8) pPacket + MM_PACKET_DESC_SIZE);
-    } /* for */
-#endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
-
-    /* Initialize the rest of the packet descriptors. */
-    Status = MM_InitializeUmPackets(pDevice);
-    if(Status != LM_STATUS_SUCCESS)
-    {
-       return Status;
-    } /* if */
+       /* Create the Jumbo packet descriptors. */
+       for (j = 0; j < pDevice->RxJumboDescCnt; j++) {
+               /* Receive producer ring. */
+               pPacket->u.Rx.RcvProdRing = T3_JUMBO_RCV_PROD_RING;
 
-    /* Default receive mask. */
-    pDevice->ReceiveMask = LM_ACCEPT_MULTICAST | LM_ACCEPT_BROADCAST |
-       LM_ACCEPT_UNICAST;
+               /* Receive buffer size. */
+               pPacket->u.Rx.RxBufferSize = pDevice->RxJumboBufferSize;
 
-    /* Make sure we are in the first 32k memory window or NicSendBd. */
-    REG_WR(pDevice, PciCfg.MemWindowBaseAddr, 0);
+               /* Add the descriptor to RxPacketFreeQ. */
+               QQ_PushTail (&pDevice->RxPacketFreeQ.Container, pPacket);
 
-    /* Initialize the hardware. */
-    Status = LM_ResetAdapter(pDevice);
-    if(Status != LM_STATUS_SUCCESS)
-    {
-       return Status;
-    }
+               /* Get the pointer to the next descriptor.  MM_PACKET_DESC_SIZE */
+               /* is the total size of the packet descriptor including the */
+               /* os-specific extensions in the UM_PACKET structure. */
+               pPacket =
+                   (PLM_PACKET) ((PLM_UINT8) pPacket + MM_PACKET_DESC_SIZE);
+       }                       /* for */
+#endif                         /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
+
+       /* Initialize the rest of the packet descriptors. */
+       Status = MM_InitializeUmPackets (pDevice);
+       if (Status != LM_STATUS_SUCCESS) {
+               return Status;
+       }
 
-    /* We are done with initialization. */
-    pDevice->InitDone = TRUE;
+       /* if */
+       /* Default receive mask. */
+       pDevice->ReceiveMask = LM_ACCEPT_MULTICAST | LM_ACCEPT_BROADCAST |
+           LM_ACCEPT_UNICAST;
 
-    return LM_STATUS_SUCCESS;
-} /* LM_InitializeAdapter */
+       /* Make sure we are in the first 32k memory window or NicSendBd. */
+       REG_WR (pDevice, PciCfg.MemWindowBaseAddr, 0);
 
+       /* Initialize the hardware. */
+       Status = LM_ResetAdapter (pDevice);
+       if (Status != LM_STATUS_SUCCESS) {
+               return Status;
+       }
+
+       /* We are done with initialization. */
+       pDevice->InitDone = TRUE;
+
+       return LM_STATUS_SUCCESS;
+}                              /* LM_InitializeAdapter */
 
 /******************************************************************************/
 /* Description:                                                               */
@@ -1878,414 +1718,408 @@ PLM_DEVICE_BLOCK pDevice)
 /*    LM_STATUS_SUCCESS                                                       */
 /******************************************************************************/
 LM_STATUS
-LM_CntrlBlock(
-PLM_DEVICE_BLOCK pDevice,
-LM_UINT32 mask,LM_UINT32 cntrl)
+LM_CntrlBlock (PLM_DEVICE_BLOCK pDevice, LM_UINT32 mask, LM_UINT32 cntrl)
 {
-    LM_UINT32 j,i,data;
-    LM_UINT32 MaxWaitCnt;
-
-    MaxWaitCnt = 2;
-    j = 0;
-
-    for(i = 0 ; i < 32; i++)
-    {
-       if(!(mask & (1 << i)))
-           continue;
-
-       switch (1 << i)
-       {
-           case T3_BLOCK_DMA_RD:
-               data = REG_RD(pDevice, DmaRead.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~DMA_READ_MODE_ENABLE;
-                   REG_WR(pDevice, DmaRead.Mode, data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, DmaRead.Mode) & DMA_READ_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, DmaRead.Mode, data | DMA_READ_MODE_ENABLE);
-               break;
-
-           case T3_BLOCK_DMA_COMP:
-               data = REG_RD(pDevice,DmaComp.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~DMA_COMP_MODE_ENABLE;
-                   REG_WR(pDevice, DmaComp.Mode, data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, DmaComp.Mode) & DMA_COMP_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, DmaComp.Mode, data | DMA_COMP_MODE_ENABLE);
-               break;
+       LM_UINT32 j, i, data;
+       LM_UINT32 MaxWaitCnt;
+
+       MaxWaitCnt = 2;
+       j = 0;
+
+       for (i = 0; i < 32; i++) {
+               if (!(mask & (1 << i)))
+                       continue;
+
+               switch (1 << i) {
+               case T3_BLOCK_DMA_RD:
+                       data = REG_RD (pDevice, DmaRead.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~DMA_READ_MODE_ENABLE;
+                               REG_WR (pDevice, DmaRead.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, DmaRead.Mode) &
+                                            DMA_READ_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, DmaRead.Mode,
+                                       data | DMA_READ_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_RX_BD_INITIATOR:
-               data = REG_RD(pDevice, RcvBdIn.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~RCV_BD_IN_MODE_ENABLE;
-                   REG_WR(pDevice, RcvBdIn.Mode,data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, RcvBdIn.Mode) & RCV_BD_IN_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, RcvBdIn.Mode,data | RCV_BD_IN_MODE_ENABLE);
-               break;
+               case T3_BLOCK_DMA_COMP:
+                       data = REG_RD (pDevice, DmaComp.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~DMA_COMP_MODE_ENABLE;
+                               REG_WR (pDevice, DmaComp.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, DmaComp.Mode) &
+                                            DMA_COMP_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, DmaComp.Mode,
+                                       data | DMA_COMP_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_RX_BD_COMP:
-               data = REG_RD(pDevice, RcvBdComp.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~RCV_BD_COMP_MODE_ENABLE;
-                   REG_WR(pDevice, RcvBdComp.Mode,data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, RcvBdComp.Mode) & RCV_BD_COMP_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, RcvBdComp.Mode,data | RCV_BD_COMP_MODE_ENABLE);
-               break;
+               case T3_BLOCK_RX_BD_INITIATOR:
+                       data = REG_RD (pDevice, RcvBdIn.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~RCV_BD_IN_MODE_ENABLE;
+                               REG_WR (pDevice, RcvBdIn.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, RcvBdIn.Mode) &
+                                            RCV_BD_IN_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, RcvBdIn.Mode,
+                                       data | RCV_BD_IN_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_DMA_WR:
-               data = REG_RD(pDevice, DmaWrite.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~DMA_WRITE_MODE_ENABLE;
-                   REG_WR(pDevice, DmaWrite.Mode,data);
+               case T3_BLOCK_RX_BD_COMP:
+                       data = REG_RD (pDevice, RcvBdComp.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~RCV_BD_COMP_MODE_ENABLE;
+                               REG_WR (pDevice, RcvBdComp.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, RcvBdComp.Mode) &
+                                            RCV_BD_COMP_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, RcvBdComp.Mode,
+                                       data | RCV_BD_COMP_MODE_ENABLE);
+                       break;
 
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, DmaWrite.Mode) & DMA_WRITE_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, DmaWrite.Mode,data | DMA_WRITE_MODE_ENABLE);
-               break;
+               case T3_BLOCK_DMA_WR:
+                       data = REG_RD (pDevice, DmaWrite.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~DMA_WRITE_MODE_ENABLE;
+                               REG_WR (pDevice, DmaWrite.Mode, data);
+
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, DmaWrite.Mode) &
+                                            DMA_WRITE_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, DmaWrite.Mode,
+                                       data | DMA_WRITE_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_MSI_HANDLER:
-               data = REG_RD(pDevice, Msi.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~MSI_MODE_ENABLE;
-                   REG_WR(pDevice, Msi.Mode, data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, Msi.Mode) & MSI_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, Msi.Mode, data |MSI_MODE_ENABLE);
-               break;
+               case T3_BLOCK_MSI_HANDLER:
+                       data = REG_RD (pDevice, Msi.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~MSI_MODE_ENABLE;
+                               REG_WR (pDevice, Msi.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, Msi.Mode) &
+                                            MSI_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, Msi.Mode,
+                                       data | MSI_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_RX_LIST_PLMT:
-               data = REG_RD(pDevice, RcvListPlmt.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~RCV_LIST_PLMT_MODE_ENABLE;
-                   REG_WR(pDevice, RcvListPlmt.Mode,data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, RcvListPlmt.Mode) & RCV_LIST_PLMT_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, RcvListPlmt.Mode,data | RCV_LIST_PLMT_MODE_ENABLE);
-               break;
+               case T3_BLOCK_RX_LIST_PLMT:
+                       data = REG_RD (pDevice, RcvListPlmt.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~RCV_LIST_PLMT_MODE_ENABLE;
+                               REG_WR (pDevice, RcvListPlmt.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, RcvListPlmt.Mode)
+                                            & RCV_LIST_PLMT_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, RcvListPlmt.Mode,
+                                       data | RCV_LIST_PLMT_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_RX_LIST_SELECTOR:
-               data = REG_RD(pDevice, RcvListSel.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~RCV_LIST_SEL_MODE_ENABLE;
-                   REG_WR(pDevice, RcvListSel.Mode,data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, RcvListSel.Mode) & RCV_LIST_SEL_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, RcvListSel.Mode,data |RCV_LIST_SEL_MODE_ENABLE);
-               break;
+               case T3_BLOCK_RX_LIST_SELECTOR:
+                       data = REG_RD (pDevice, RcvListSel.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~RCV_LIST_SEL_MODE_ENABLE;
+                               REG_WR (pDevice, RcvListSel.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, RcvListSel.Mode) &
+                                            RCV_LIST_SEL_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, RcvListSel.Mode,
+                                       data | RCV_LIST_SEL_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_RX_DATA_INITIATOR:
-               data = REG_RD(pDevice, RcvDataBdIn.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~RCV_DATA_BD_IN_MODE_ENABLE;
-                   REG_WR(pDevice, RcvDataBdIn.Mode,data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, RcvDataBdIn.Mode) & RCV_DATA_BD_IN_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, RcvDataBdIn.Mode, data | RCV_DATA_BD_IN_MODE_ENABLE);
-               break;
+               case T3_BLOCK_RX_DATA_INITIATOR:
+                       data = REG_RD (pDevice, RcvDataBdIn.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~RCV_DATA_BD_IN_MODE_ENABLE;
+                               REG_WR (pDevice, RcvDataBdIn.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, RcvDataBdIn.Mode)
+                                            & RCV_DATA_BD_IN_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, RcvDataBdIn.Mode,
+                                       data | RCV_DATA_BD_IN_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_RX_DATA_COMP:
-               data = REG_RD(pDevice, RcvDataComp.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~RCV_DATA_COMP_MODE_ENABLE;
-                   REG_WR(pDevice, RcvDataComp.Mode,data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, RcvDataBdIn.Mode) & RCV_DATA_COMP_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, RcvDataComp.Mode,data | RCV_DATA_COMP_MODE_ENABLE);
-               break;
+               case T3_BLOCK_RX_DATA_COMP:
+                       data = REG_RD (pDevice, RcvDataComp.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~RCV_DATA_COMP_MODE_ENABLE;
+                               REG_WR (pDevice, RcvDataComp.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, RcvDataBdIn.Mode)
+                                            & RCV_DATA_COMP_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, RcvDataComp.Mode,
+                                       data | RCV_DATA_COMP_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_HOST_COALESING:
-               data = REG_RD(pDevice, HostCoalesce.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~HOST_COALESCE_ENABLE;
-                   REG_WR(pDevice, HostCoalesce.Mode, data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, SndBdIn.Mode) & HOST_COALESCE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, HostCoalesce.Mode, data | HOST_COALESCE_ENABLE);
-               break;
+               case T3_BLOCK_HOST_COALESING:
+                       data = REG_RD (pDevice, HostCoalesce.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~HOST_COALESCE_ENABLE;
+                               REG_WR (pDevice, HostCoalesce.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, SndBdIn.Mode) &
+                                            HOST_COALESCE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, HostCoalesce.Mode,
+                                       data | HOST_COALESCE_ENABLE);
+                       break;
 
-           case T3_BLOCK_MAC_RX_ENGINE:
-               if(cntrl == LM_DISABLE)
-               {
-                   pDevice->RxMode &= ~RX_MODE_ENABLE;
-                   REG_WR(pDevice, MacCtrl.RxMode, pDevice->RxMode);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, MacCtrl.RxMode) & RX_MODE_ENABLE))
-                       {
-                           break;
+               case T3_BLOCK_MAC_RX_ENGINE:
+                       if (cntrl == LM_DISABLE) {
+                               pDevice->RxMode &= ~RX_MODE_ENABLE;
+                               REG_WR (pDevice, MacCtrl.RxMode,
+                                       pDevice->RxMode);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, MacCtrl.RxMode) &
+                                            RX_MODE_ENABLE)) {
+                                               break;
+                                       }
+                                       MM_Wait (10);
+                               }
+                       } else {
+                               pDevice->RxMode |= RX_MODE_ENABLE;
+                               REG_WR (pDevice, MacCtrl.RxMode,
+                                       pDevice->RxMode);
                        }
-                       MM_Wait(10);
-                   }
-               }
-               else
-               {
-                   pDevice->RxMode |= RX_MODE_ENABLE;
-                   REG_WR(pDevice, MacCtrl.RxMode, pDevice->RxMode);
-               }
-               break;
+                       break;
 
-           case T3_BLOCK_MBUF_CLUSTER_FREE:
-               data = REG_RD(pDevice, MbufClusterFree.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~MBUF_CLUSTER_FREE_MODE_ENABLE;
-                   REG_WR(pDevice, MbufClusterFree.Mode,data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, MbufClusterFree.Mode) & MBUF_CLUSTER_FREE_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, MbufClusterFree.Mode, data | MBUF_CLUSTER_FREE_MODE_ENABLE);
-               break;
+               case T3_BLOCK_MBUF_CLUSTER_FREE:
+                       data = REG_RD (pDevice, MbufClusterFree.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~MBUF_CLUSTER_FREE_MODE_ENABLE;
+                               REG_WR (pDevice, MbufClusterFree.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD
+                                            (pDevice,
+                                             MbufClusterFree.
+                                             Mode) &
+                                            MBUF_CLUSTER_FREE_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, MbufClusterFree.Mode,
+                                       data | MBUF_CLUSTER_FREE_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_SEND_BD_INITIATOR:
-               data = REG_RD(pDevice, SndBdIn.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~SND_BD_IN_MODE_ENABLE;
-                   REG_WR(pDevice, SndBdIn.Mode, data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, SndBdIn.Mode) & SND_BD_IN_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, SndBdIn.Mode, data  | SND_BD_IN_MODE_ENABLE);
-               break;
+               case T3_BLOCK_SEND_BD_INITIATOR:
+                       data = REG_RD (pDevice, SndBdIn.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~SND_BD_IN_MODE_ENABLE;
+                               REG_WR (pDevice, SndBdIn.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, SndBdIn.Mode) &
+                                            SND_BD_IN_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, SndBdIn.Mode,
+                                       data | SND_BD_IN_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_SEND_BD_COMP:
-               data = REG_RD(pDevice, SndBdComp.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~SND_BD_COMP_MODE_ENABLE;
-                   REG_WR(pDevice, SndBdComp.Mode, data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, SndBdComp.Mode) & SND_BD_COMP_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, SndBdComp.Mode, data | SND_BD_COMP_MODE_ENABLE);
-               break;
+               case T3_BLOCK_SEND_BD_COMP:
+                       data = REG_RD (pDevice, SndBdComp.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~SND_BD_COMP_MODE_ENABLE;
+                               REG_WR (pDevice, SndBdComp.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, SndBdComp.Mode) &
+                                            SND_BD_COMP_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, SndBdComp.Mode,
+                                       data | SND_BD_COMP_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_SEND_BD_SELECTOR:
-               data = REG_RD(pDevice, SndBdSel.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~SND_BD_SEL_MODE_ENABLE;
-                   REG_WR(pDevice, SndBdSel.Mode, data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, SndBdSel.Mode) & SND_BD_SEL_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, SndBdSel.Mode, data | SND_BD_SEL_MODE_ENABLE);
-               break;
+               case T3_BLOCK_SEND_BD_SELECTOR:
+                       data = REG_RD (pDevice, SndBdSel.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~SND_BD_SEL_MODE_ENABLE;
+                               REG_WR (pDevice, SndBdSel.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, SndBdSel.Mode) &
+                                            SND_BD_SEL_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, SndBdSel.Mode,
+                                       data | SND_BD_SEL_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_SEND_DATA_INITIATOR:
-               data = REG_RD(pDevice, SndDataIn.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~T3_SND_DATA_IN_MODE_ENABLE;
-                   REG_WR(pDevice, SndDataIn.Mode,data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, SndDataIn.Mode) & T3_SND_DATA_IN_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, SndDataIn.Mode,data | T3_SND_DATA_IN_MODE_ENABLE);
-               break;
+               case T3_BLOCK_SEND_DATA_INITIATOR:
+                       data = REG_RD (pDevice, SndDataIn.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~T3_SND_DATA_IN_MODE_ENABLE;
+                               REG_WR (pDevice, SndDataIn.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, SndDataIn.Mode) &
+                                            T3_SND_DATA_IN_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, SndDataIn.Mode,
+                                       data | T3_SND_DATA_IN_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_SEND_DATA_COMP:
-               data = REG_RD(pDevice, SndDataComp.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~SND_DATA_COMP_MODE_ENABLE;
-                   REG_WR(pDevice, SndDataComp.Mode, data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, SndDataComp.Mode) & SND_DATA_COMP_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, SndDataComp.Mode,data | SND_DATA_COMP_MODE_ENABLE);
-               break;
+               case T3_BLOCK_SEND_DATA_COMP:
+                       data = REG_RD (pDevice, SndDataComp.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~SND_DATA_COMP_MODE_ENABLE;
+                               REG_WR (pDevice, SndDataComp.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, SndDataComp.Mode)
+                                            & SND_DATA_COMP_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, SndDataComp.Mode,
+                                       data | SND_DATA_COMP_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_MAC_TX_ENGINE:
-               if(cntrl == LM_DISABLE)
-               {
-                   pDevice->TxMode &= ~TX_MODE_ENABLE;
-                   REG_WR(pDevice, MacCtrl.TxMode, pDevice->TxMode);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, MacCtrl.TxMode) & TX_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-               {
-                   pDevice->TxMode |= TX_MODE_ENABLE;
-                   REG_WR(pDevice, MacCtrl.TxMode, pDevice->TxMode);
-               }
-               break;
+               case T3_BLOCK_MAC_TX_ENGINE:
+                       if (cntrl == LM_DISABLE) {
+                               pDevice->TxMode &= ~TX_MODE_ENABLE;
+                               REG_WR (pDevice, MacCtrl.TxMode,
+                                       pDevice->TxMode);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, MacCtrl.TxMode) &
+                                            TX_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else {
+                               pDevice->TxMode |= TX_MODE_ENABLE;
+                               REG_WR (pDevice, MacCtrl.TxMode,
+                                       pDevice->TxMode);
+                       }
+                       break;
 
-           case T3_BLOCK_MEM_ARBITOR:
-               data = REG_RD(pDevice, MemArbiter.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~T3_MEM_ARBITER_MODE_ENABLE;
-                   REG_WR(pDevice, MemArbiter.Mode, data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, MemArbiter.Mode) & T3_MEM_ARBITER_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, MemArbiter.Mode,data|T3_MEM_ARBITER_MODE_ENABLE);
-               break;
+               case T3_BLOCK_MEM_ARBITOR:
+                       data = REG_RD (pDevice, MemArbiter.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~T3_MEM_ARBITER_MODE_ENABLE;
+                               REG_WR (pDevice, MemArbiter.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, MemArbiter.Mode) &
+                                            T3_MEM_ARBITER_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, MemArbiter.Mode,
+                                       data | T3_MEM_ARBITER_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_MBUF_MANAGER:
-               data = REG_RD(pDevice, BufMgr.Mode);
-               if (cntrl == LM_DISABLE)
-               {
-                   data &= ~BUFMGR_MODE_ENABLE;
-                   REG_WR(pDevice, BufMgr.Mode,data);
-                   for(j = 0; j < MaxWaitCnt; j++)
-                   {
-                       if(!(REG_RD(pDevice, BufMgr.Mode) & BUFMGR_MODE_ENABLE))
-                           break;
-                       MM_Wait(10);
-                   }
-               }
-               else
-                   REG_WR(pDevice, BufMgr.Mode,data |  BUFMGR_MODE_ENABLE);
-               break;
+               case T3_BLOCK_MBUF_MANAGER:
+                       data = REG_RD (pDevice, BufMgr.Mode);
+                       if (cntrl == LM_DISABLE) {
+                               data &= ~BUFMGR_MODE_ENABLE;
+                               REG_WR (pDevice, BufMgr.Mode, data);
+                               for (j = 0; j < MaxWaitCnt; j++) {
+                                       if (!
+                                           (REG_RD (pDevice, BufMgr.Mode) &
+                                            BUFMGR_MODE_ENABLE))
+                                               break;
+                                       MM_Wait (10);
+                               }
+                       } else
+                               REG_WR (pDevice, BufMgr.Mode,
+                                       data | BUFMGR_MODE_ENABLE);
+                       break;
 
-           case T3_BLOCK_MAC_GLOBAL:
-               if(cntrl == LM_DISABLE)
-               {
-                   pDevice->MacMode &= ~(MAC_MODE_ENABLE_TDE |
-                       MAC_MODE_ENABLE_RDE |
-                       MAC_MODE_ENABLE_FHDE);
-               }
-               else
-               {
-                   pDevice->MacMode |= (MAC_MODE_ENABLE_TDE |
-                       MAC_MODE_ENABLE_RDE |
-                       MAC_MODE_ENABLE_FHDE);
-               }
-               REG_WR(pDevice, MacCtrl.Mode, pDevice->MacMode);
-               break;
+               case T3_BLOCK_MAC_GLOBAL:
+                       if (cntrl == LM_DISABLE) {
+                               pDevice->MacMode &= ~(MAC_MODE_ENABLE_TDE |
+                                                     MAC_MODE_ENABLE_RDE |
+                                                     MAC_MODE_ENABLE_FHDE);
+                       } else {
+                               pDevice->MacMode |= (MAC_MODE_ENABLE_TDE |
+                                                    MAC_MODE_ENABLE_RDE |
+                                                    MAC_MODE_ENABLE_FHDE);
+                       }
+                       REG_WR (pDevice, MacCtrl.Mode, pDevice->MacMode);
+                       break;
 
-           default:
-               return LM_STATUS_FAILURE;
-       } /* switch */
+               default:
+                       return LM_STATUS_FAILURE;
+               }               /* switch */
 
-       if(j >= MaxWaitCnt)
-       {
-           return LM_STATUS_FAILURE;
+               if (j >= MaxWaitCnt) {
+                       return LM_STATUS_FAILURE;
+               }
        }
-    }
 
-    return LM_STATUS_SUCCESS;
+       return LM_STATUS_SUCCESS;
 }
 
 /******************************************************************************/
@@ -2295,682 +2129,631 @@ LM_UINT32 mask,LM_UINT32 cntrl)
 /* Return:                                                                    */
 /*    LM_STATUS_SUCCESS                                                       */
 /******************************************************************************/
-LM_STATUS
-LM_ResetAdapter(
-PLM_DEVICE_BLOCK pDevice)
+LM_STATUS LM_ResetAdapter (PLM_DEVICE_BLOCK pDevice)
 {
-    LM_UINT32 Value32;
-    LM_UINT16 Value16;
-    LM_UINT32 j, k;
+       LM_UINT32 Value32;
+       LM_UINT16 Value16;
+       LM_UINT32 j, k;
 
-    /* Disable interrupt. */
-    LM_DisableInterrupt(pDevice);
+       /* Disable interrupt. */
+       LM_DisableInterrupt (pDevice);
 
-    /* May get a spurious interrupt */
-    pDevice->pStatusBlkVirt->Status = STATUS_BLOCK_UPDATED;
+       /* May get a spurious interrupt */
+       pDevice->pStatusBlkVirt->Status = STATUS_BLOCK_UPDATED;
 
-    /* Disable transmit and receive DMA engines.  Abort all pending requests. */
-    if(pDevice->InitDone)
-    {
-       LM_Abort(pDevice);
-    }
+       /* Disable transmit and receive DMA engines.  Abort all pending requests. */
+       if (pDevice->InitDone) {
+               LM_Abort (pDevice);
+       }
 
-    pDevice->ShuttingDown = FALSE;
+       pDevice->ShuttingDown = FALSE;
 
-    LM_ResetChip(pDevice);
+       LM_ResetChip (pDevice);
 
-    /* Bug: Athlon fix for B3 silicon only.  This bit does not do anything */
-    /* in other chip revisions. */
-    if(pDevice->DelayPciGrant)
-    {
-       Value32 = REG_RD(pDevice, PciCfg.ClockCtrl);
-       REG_WR(pDevice, PciCfg.ClockCtrl, Value32 | BIT_31);
-    }
+       /* Bug: Athlon fix for B3 silicon only.  This bit does not do anything */
+       /* in other chip revisions. */
+       if (pDevice->DelayPciGrant) {
+               Value32 = REG_RD (pDevice, PciCfg.ClockCtrl);
+               REG_WR (pDevice, PciCfg.ClockCtrl, Value32 | BIT_31);
+       }
 
-    if(pDevice->ChipRevId == T3_CHIP_ID_5704_A0)
-    {
-       if (!(pDevice->PciState & T3_PCI_STATE_CONVENTIONAL_PCI_MODE))
-       {
-           Value32 = REG_RD(pDevice, PciCfg.PciState);
-           Value32 |= T3_PCI_STATE_RETRY_SAME_DMA;
-           REG_WR(pDevice, PciCfg.PciState, Value32);
-       }
-    }
-
-    /* Enable TaggedStatus mode. */
-    if(pDevice->UseTaggedStatus)
-    {
-       pDevice->MiscHostCtrl |= MISC_HOST_CTRL_ENABLE_TAGGED_STATUS_MODE;
-    }
-
-    /* Restore PCI configuration registers. */
-    MM_WriteConfig32(pDevice, PCI_CACHE_LINE_SIZE_REG,
-       pDevice->SavedCacheLineReg);
-    MM_WriteConfig32(pDevice, PCI_SUBSYSTEM_VENDOR_ID_REG,
-       (pDevice->SubsystemId << 16) | pDevice->SubsystemVendorId);
-
-    /* Clear the statistics block. */
-    for(j = 0x0300; j < 0x0b00; j++)
-    {
-       MEM_WR_OFFSET(pDevice, j, 0);
-    }
-
-    /* Initialize the statistis Block */
-    pDevice->pStatusBlkVirt->Status = 0;
-    pDevice->pStatusBlkVirt->RcvStdConIdx = 0;
-    pDevice->pStatusBlkVirt->RcvJumboConIdx = 0;
-    pDevice->pStatusBlkVirt->RcvMiniConIdx = 0;
-
-    for(j = 0; j < 16; j++)
-    {
-       pDevice->pStatusBlkVirt->Idx[j].RcvProdIdx = 0;
-       pDevice->pStatusBlkVirt->Idx[j].SendConIdx = 0;
-    }
-
-    for(k = 0; k < T3_STD_RCV_RCB_ENTRY_COUNT ;k++)
-    {
-       pDevice->pRxStdBdVirt[k].HostAddr.High = 0;
-       pDevice->pRxStdBdVirt[k].HostAddr.Low = 0;
-    }
+       if (pDevice->ChipRevId == T3_CHIP_ID_5704_A0) {
+               if (!(pDevice->PciState & T3_PCI_STATE_CONVENTIONAL_PCI_MODE)) {
+                       Value32 = REG_RD (pDevice, PciCfg.PciState);
+                       Value32 |= T3_PCI_STATE_RETRY_SAME_DMA;
+                       REG_WR (pDevice, PciCfg.PciState, Value32);
+               }
+       }
+
+       /* Enable TaggedStatus mode. */
+       if (pDevice->UseTaggedStatus) {
+               pDevice->MiscHostCtrl |=
+                   MISC_HOST_CTRL_ENABLE_TAGGED_STATUS_MODE;
+       }
+
+       /* Restore PCI configuration registers. */
+       MM_WriteConfig32 (pDevice, PCI_CACHE_LINE_SIZE_REG,
+                         pDevice->SavedCacheLineReg);
+       MM_WriteConfig32 (pDevice, PCI_SUBSYSTEM_VENDOR_ID_REG,
+                         (pDevice->SubsystemId << 16) | pDevice->
+                         SubsystemVendorId);
+
+       /* Clear the statistics block. */
+       for (j = 0x0300; j < 0x0b00; j++) {
+               MEM_WR_OFFSET (pDevice, j, 0);
+       }
+
+       /* Initialize the statistis Block */
+       pDevice->pStatusBlkVirt->Status = 0;
+       pDevice->pStatusBlkVirt->RcvStdConIdx = 0;
+       pDevice->pStatusBlkVirt->RcvJumboConIdx = 0;
+       pDevice->pStatusBlkVirt->RcvMiniConIdx = 0;
+
+       for (j = 0; j < 16; j++) {
+               pDevice->pStatusBlkVirt->Idx[j].RcvProdIdx = 0;
+               pDevice->pStatusBlkVirt->Idx[j].SendConIdx = 0;
+       }
+
+       for (k = 0; k < T3_STD_RCV_RCB_ENTRY_COUNT; k++) {
+               pDevice->pRxStdBdVirt[k].HostAddr.High = 0;
+               pDevice->pRxStdBdVirt[k].HostAddr.Low = 0;
+       }
 
 #if T3_JUMBO_RCV_RCB_ENTRY_COUNT
-    /* Receive jumbo BD buffer. */
-    for(k = 0; k < T3_JUMBO_RCV_RCB_ENTRY_COUNT; k++)
-    {
-       pDevice->pRxJumboBdVirt[k].HostAddr.High = 0;
-       pDevice->pRxJumboBdVirt[k].HostAddr.Low = 0;
-    }
+       /* Receive jumbo BD buffer. */
+       for (k = 0; k < T3_JUMBO_RCV_RCB_ENTRY_COUNT; k++) {
+               pDevice->pRxJumboBdVirt[k].HostAddr.High = 0;
+               pDevice->pRxJumboBdVirt[k].HostAddr.Low = 0;
+       }
 #endif
 
-    REG_WR(pDevice, PciCfg.DmaReadWriteCtrl, pDevice->DmaReadWriteCtrl);
+       REG_WR (pDevice, PciCfg.DmaReadWriteCtrl, pDevice->DmaReadWriteCtrl);
 
-    /* GRC mode control register. */
-#ifdef BIG_ENDIAN_PCI    /* Jimmy, this ifdef block deleted in new code! */
-    Value32 =
-       GRC_MODE_WORD_SWAP_DATA |
-       GRC_MODE_WORD_SWAP_NON_FRAME_DATA |
-       GRC_MODE_INT_ON_MAC_ATTN |
-       GRC_MODE_HOST_STACK_UP;
+       /* GRC mode control register. */
+#ifdef BIG_ENDIAN_PCI          /* Jimmy, this ifdef block deleted in new code! */
+       Value32 =
+           GRC_MODE_WORD_SWAP_DATA |
+           GRC_MODE_WORD_SWAP_NON_FRAME_DATA |
+           GRC_MODE_INT_ON_MAC_ATTN | GRC_MODE_HOST_STACK_UP;
 #else
-    /* No CPU Swap modes for PCI IO */
-    Value32 =
+       /* No CPU Swap modes for PCI IO */
+       Value32 =
 #ifdef BIG_ENDIAN_HOST
-       GRC_MODE_BYTE_SWAP_NON_FRAME_DATA |
-       GRC_MODE_WORD_SWAP_NON_FRAME_DATA |
-       GRC_MODE_BYTE_SWAP_DATA |
-       GRC_MODE_WORD_SWAP_DATA |
+           GRC_MODE_BYTE_SWAP_NON_FRAME_DATA |
+           GRC_MODE_WORD_SWAP_NON_FRAME_DATA |
+           GRC_MODE_BYTE_SWAP_DATA | GRC_MODE_WORD_SWAP_DATA |
 #else
-       GRC_MODE_WORD_SWAP_NON_FRAME_DATA |
-       GRC_MODE_BYTE_SWAP_DATA |
-       GRC_MODE_WORD_SWAP_DATA |
+           GRC_MODE_WORD_SWAP_NON_FRAME_DATA |
+           GRC_MODE_BYTE_SWAP_DATA | GRC_MODE_WORD_SWAP_DATA |
 #endif
-       GRC_MODE_INT_ON_MAC_ATTN |
-       GRC_MODE_HOST_STACK_UP;
-#endif /* !BIG_ENDIAN_PCI */
-
-    /* Configure send BD mode. */
-    if(pDevice->NicSendBd == FALSE)
-    {
-       Value32 |= GRC_MODE_HOST_SEND_BDS;
-    }
-    else
-    {
-       Value32 |= GRC_MODE_4X_NIC_BASED_SEND_RINGS;
-    }
-
-    /* Configure pseudo checksum mode. */
-    if(pDevice->NoTxPseudoHdrChksum)
-    {
-       Value32 |= GRC_MODE_TX_NO_PSEUDO_HEADER_CHKSUM;
-    }
-
-    if(pDevice->NoRxPseudoHdrChksum)
-    {
-       Value32 |= GRC_MODE_RX_NO_PSEUDO_HEADER_CHKSUM;
-    }
-
-    REG_WR(pDevice, Grc.Mode, Value32);
-
-    /* Setup the timer prescalar register. */
-    REG_WR(pDevice, Grc.MiscCfg, 65 << 1);      /* Clock is alwasy 66Mhz. */
-
-    /* Set up the MBUF pool base address and size. */
-    REG_WR(pDevice, BufMgr.MbufPoolAddr, pDevice->MbufBase);
-    REG_WR(pDevice, BufMgr.MbufPoolSize, pDevice->MbufSize);
-
-    /* Set up the DMA descriptor pool base address and size. */
-    REG_WR(pDevice, BufMgr.DmaDescPoolAddr, T3_NIC_DMA_DESC_POOL_ADDR);
-    REG_WR(pDevice, BufMgr.DmaDescPoolSize, T3_NIC_DMA_DESC_POOL_SIZE);
-
-    /* Configure MBUF and Threshold watermarks */
-    /* Configure the DMA read MBUF low water mark. */
-    if(pDevice->DmaMbufLowMark)
-    {
-       REG_WR(pDevice, BufMgr.MbufReadDmaLowWaterMark,
-           pDevice->DmaMbufLowMark);
-    }
-    else
-    {
-       if(pDevice->TxMtu < MAX_ETHERNET_PACKET_BUFFER_SIZE)
-       {
-           REG_WR(pDevice, BufMgr.MbufReadDmaLowWaterMark,
-               T3_DEF_DMA_MBUF_LOW_WMARK);
+           GRC_MODE_INT_ON_MAC_ATTN | GRC_MODE_HOST_STACK_UP;
+#endif                         /* !BIG_ENDIAN_PCI */
+
+       /* Configure send BD mode. */
+       if (pDevice->NicSendBd == FALSE) {
+               Value32 |= GRC_MODE_HOST_SEND_BDS;
+       } else {
+               Value32 |= GRC_MODE_4X_NIC_BASED_SEND_RINGS;
        }
-       else
-       {
-           REG_WR(pDevice, BufMgr.MbufReadDmaLowWaterMark,
-               T3_DEF_DMA_MBUF_LOW_WMARK_JUMBO);
-       }
-    }
-
-    /* Configure the MAC Rx MBUF low water mark. */
-    if(pDevice->RxMacMbufLowMark)
-    {
-       REG_WR(pDevice, BufMgr.MbufMacRxLowWaterMark,
-           pDevice->RxMacMbufLowMark);
-    }
-    else
-    {
-       if(pDevice->TxMtu < MAX_ETHERNET_PACKET_BUFFER_SIZE)
-       {
-           REG_WR(pDevice, BufMgr.MbufMacRxLowWaterMark,
-               T3_DEF_RX_MAC_MBUF_LOW_WMARK);
+
+       /* Configure pseudo checksum mode. */
+       if (pDevice->NoTxPseudoHdrChksum) {
+               Value32 |= GRC_MODE_TX_NO_PSEUDO_HEADER_CHKSUM;
        }
-       else
-       {
-           REG_WR(pDevice, BufMgr.MbufMacRxLowWaterMark,
-               T3_DEF_RX_MAC_MBUF_LOW_WMARK_JUMBO);
-       }
-    }
-
-    /* Configure the MBUF high water mark. */
-    if(pDevice->MbufHighMark)
-    {
-       REG_WR(pDevice, BufMgr.MbufHighWaterMark, pDevice->MbufHighMark);
-    }
-    else
-    {
-       if(pDevice->TxMtu < MAX_ETHERNET_PACKET_BUFFER_SIZE)
-       {
-           REG_WR(pDevice, BufMgr.MbufHighWaterMark,
-               T3_DEF_MBUF_HIGH_WMARK);
+
+       if (pDevice->NoRxPseudoHdrChksum) {
+               Value32 |= GRC_MODE_RX_NO_PSEUDO_HEADER_CHKSUM;
        }
-       else
-       {
-           REG_WR(pDevice, BufMgr.MbufHighWaterMark,
-               T3_DEF_MBUF_HIGH_WMARK_JUMBO);
+
+       REG_WR (pDevice, Grc.Mode, Value32);
+
+       /* Setup the timer prescalar register. */
+       REG_WR (pDevice, Grc.MiscCfg, 65 << 1); /* Clock is alwasy 66Mhz. */
+
+       /* Set up the MBUF pool base address and size. */
+       REG_WR (pDevice, BufMgr.MbufPoolAddr, pDevice->MbufBase);
+       REG_WR (pDevice, BufMgr.MbufPoolSize, pDevice->MbufSize);
+
+       /* Set up the DMA descriptor pool base address and size. */
+       REG_WR (pDevice, BufMgr.DmaDescPoolAddr, T3_NIC_DMA_DESC_POOL_ADDR);
+       REG_WR (pDevice, BufMgr.DmaDescPoolSize, T3_NIC_DMA_DESC_POOL_SIZE);
+
+       /* Configure MBUF and Threshold watermarks */
+       /* Configure the DMA read MBUF low water mark. */
+       if (pDevice->DmaMbufLowMark) {
+               REG_WR (pDevice, BufMgr.MbufReadDmaLowWaterMark,
+                       pDevice->DmaMbufLowMark);
+       } else {
+               if (pDevice->TxMtu < MAX_ETHERNET_PACKET_BUFFER_SIZE) {
+                       REG_WR (pDevice, BufMgr.MbufReadDmaLowWaterMark,
+                               T3_DEF_DMA_MBUF_LOW_WMARK);
+               } else {
+                       REG_WR (pDevice, BufMgr.MbufReadDmaLowWaterMark,
+                               T3_DEF_DMA_MBUF_LOW_WMARK_JUMBO);
+               }
        }
-    }
 
-    REG_WR(pDevice, BufMgr.DmaLowWaterMark, T3_DEF_DMA_DESC_LOW_WMARK);
-    REG_WR(pDevice, BufMgr.DmaHighWaterMark, T3_DEF_DMA_DESC_HIGH_WMARK);
+       /* Configure the MAC Rx MBUF low water mark. */
+       if (pDevice->RxMacMbufLowMark) {
+               REG_WR (pDevice, BufMgr.MbufMacRxLowWaterMark,
+                       pDevice->RxMacMbufLowMark);
+       } else {
+               if (pDevice->TxMtu < MAX_ETHERNET_PACKET_BUFFER_SIZE) {
+