From b4b7ff4b08e691656c9d77c758fc355833128ac0 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Wed, 20 Jan 2016 14:01:31 -0300 Subject: Linux-libre 4.4-gnu --- drivers/staging/slicoss/slic.h | 23 ++--- drivers/staging/slicoss/slichw.h | 38 ++++--- drivers/staging/slicoss/slicoss.c | 211 +++++++++++++++++++++++--------------- 3 files changed, 161 insertions(+), 111 deletions(-) (limited to 'drivers/staging/slicoss') diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h index 00b8af63e..c95b3abad 100644 --- a/drivers/staging/slicoss/slic.h +++ b/drivers/staging/slicoss/slic.h @@ -93,10 +93,10 @@ struct slic_rcvbuf_info { u32 lastid; }; /* - SLIC Handle structure. Used to restrict handle values to - 32 bits by using an index rather than an address. - Simplifies ucode in 64-bit systems -*/ + * SLIC Handle structure. Used to restrict handle values to + * 32 bits by using an index rather than an address. + * Simplifies ucode in 64-bit systems + */ struct slic_handle_word { union { struct { @@ -166,7 +166,6 @@ struct slic_cmdqueue { #define SLIC_MAX_CARDS 32 #define SLIC_MAX_PORTS 4 /* Max # of ports per card */ - struct mcast_address { unsigned char address[6]; struct mcast_address *next; @@ -334,10 +333,11 @@ struct physcard { struct physcard *next; uint adapters_allocd; -/* the following is not currently needed - u32 bridge_busnum; - u32 bridge_cfg[NUM_CFG_SPACES][NUM_CFG_REG_ULONGS]; -*/ +/* + * the following is not currently needed + * u32 bridge_busnum; + * u32 bridge_cfg[NUM_CFG_SPACES][NUM_CFG_REG_ULONGS]; + */ }; struct base_driver { @@ -447,7 +447,7 @@ struct adapter { * SLIC Handles */ /* Object handles*/ - struct slic_handle slic_handles[SLIC_CMDQ_MAXCMDS+1]; + struct slic_handle slic_handles[SLIC_CMDQ_MAXCMDS + 1]; /* Free object handles*/ struct slic_handle *pfree_slic_handles; /* Object handle list lock*/ @@ -485,7 +485,6 @@ struct adapter { struct slicnet_stats slic_stats; }; - #define UPDATE_STATS(largestat, newstat, oldstat) \ { \ if ((newstat) < (oldstat)) \ @@ -514,6 +513,6 @@ struct adapter { #define FLUSH true #define DONT_FLUSH false -#define SIOCSLICSETINTAGG (SIOCDEVPRIVATE+10) +#define SIOCSLICSETINTAGG (SIOCDEVPRIVATE + 10) #endif /* __SLIC_DRIVER_H__ */ diff --git a/drivers/staging/slicoss/slichw.h b/drivers/staging/slicoss/slichw.h index 21cd02b8b..9723b4a10 100644 --- a/drivers/staging/slicoss/slichw.h +++ b/drivers/staging/slicoss/slichw.h @@ -307,9 +307,11 @@ struct slic_regs { u32 slic_hbar; /* Header buffer address reg */ u32 pad4; - /* 31-8 - phy addr of set of contiguous hdr buffers - 7-0 - number of buffers passed - Buffers are 256 bytes long on 256-byte boundaries. */ + /* + * 31-8 - phy addr of set of contiguous hdr buffers + * 7-0 - number of buffers passed + * Buffers are 256 bytes long on 256-byte boundaries. + */ #define SLIC_HBAR 0x0020 #define SLIC_HBAR_CNT_MSK 0x000000FF @@ -321,10 +323,12 @@ struct slic_regs { #define SLIC_DBAR_SIZE 2048 u32 slic_cbar; /* Xmt Cmd buf addr regs.*/ - /* 1 per XMT interface - 31-5 - phy addr of host command buffer - 4-0 - length of cmd in multiples of 32 bytes - Buffers are 32 bytes up to 512 bytes long */ + /* + * 1 per XMT interface + * 31-5 - phy addr of host command buffer + * 4-0 - length of cmd in multiples of 32 bytes + * Buffers are 32 bytes up to 512 bytes long + */ #define SLIC_CBAR 0x0030 #define SLIC_CBAR_LEN_MSK 0x0000001F #define SLIC_CBAR_ALIGN 0x00000020 @@ -336,9 +340,11 @@ struct slic_regs { u32 slic_rbar; /* Response buffer address reg.*/ u32 pad7; - /*31-8 - phy addr of set of contiguous response buffers - 7-0 - number of buffers passed - Buffers are 32 bytes long on 32-byte boundaries.*/ + /* + * 31-8 - phy addr of set of contiguous response buffers + * 7-0 - number of buffers passed + * Buffers are 32 bytes long on 32-byte boundaries. + */ #define SLIC_RBAR 0x0038 #define SLIC_RBAR_CNT_MSK 0x000000FF #define SLIC_RBAR_SIZE 32 @@ -430,7 +436,8 @@ struct slic_regs { #define SLIC_LOW_POWER 0x00e0 u32 slic_quiesce; /* force slic into quiescent state - before soft reset */ + * before soft reset + */ u32 pad30; #define SLIC_QUIESCE 0x00e8 @@ -718,7 +725,8 @@ struct slic_eeprom { u16 DSize2Pci; /* 15 DRAM size to PCI (bytes * 64K) */ u16 RSize2Pci; /* 16 ROM extension size to PCI (bytes * 4k) */ u8 NetIntPin1; /* 17 Network Interface Pin 1 - (simba/leone only) */ + * (simba/leone only) + */ u8 NetIntPin2; /* Network Interface Pin 2 (simba/leone only)*/ union { u8 NetIntPin3; /* 18 Network Interface Pin 3 (simba only) */ @@ -748,7 +756,8 @@ struct slic_eeprom { union oemfru OemFru; /* optional OEM FRU information */ u8 Pad[4]; /* Pad to 128 bytes - includes 2 cksum bytes * (if OEM FRU info exists) and two unusable - * bytes at the end */ + * bytes at the end + */ }; /* SLIC EEPROM structure for Oasis */ @@ -772,7 +781,8 @@ struct oslic_eeprom { u16 FlashSize; /* 14 Flash size (bytes / 4K) */ u16 DSize2Pci; /* 15 DRAM size to PCI (bytes / 64K) */ u16 RSize2Pci; /* 16 Flash (ROM extension) size to PCI - (bytes / 4K) */ + * (bytes / 4K) + */ u16 DeviceId1; /* 17 Device Id (function 1) */ u16 DeviceId2; /* 18 Device Id (function 2) */ u16 CfgByte6; /* 19 Device Status Config Bytes 6-7 */ diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c index 14ed688d5..d96297ba6 100644 --- a/drivers/staging/slicoss/slicoss.c +++ b/drivers/staging/slicoss/slicoss.c @@ -54,7 +54,6 @@ * IS-NIC driver. */ - #define KLUDGE_FOR_4GB_BOUNDARY 1 #define DEBUG_MICROCODE 1 #define DBG 1 @@ -159,17 +158,20 @@ static void slic_mcast_set_bit(struct adapter *adapter, char *address) unsigned char crcpoly; /* Get the CRC polynomial for the mac address */ - /* we use bits 1-8 (lsb), bitwise reversed, - * msb (= lsb bit 0 before bitrev) is automatically discarded */ - crcpoly = ether_crc(ETH_ALEN, address)>>23; + /* + * we use bits 1-8 (lsb), bitwise reversed, + * msb (= lsb bit 0 before bitrev) is automatically discarded + */ + crcpoly = ether_crc(ETH_ALEN, address) >> 23; - /* We only have space on the SLIC for 64 entries. Lop + /* + * We only have space on the SLIC for 64 entries. Lop * off the top two bits. (2^6 = 64) */ crcpoly &= 0x3F; /* OR in the new bit into our 64 bit mask. */ - adapter->mcastmask |= (u64) 1 << crcpoly; + adapter->mcastmask |= (u64)1 << crcpoly; } static void slic_mcast_set_mask(struct adapter *adapter) @@ -177,7 +179,8 @@ static void slic_mcast_set_mask(struct adapter *adapter) __iomem struct slic_regs *slic_regs = adapter->slic_regs; if (adapter->macopts & (MAC_ALLMCAST | MAC_PROMISC)) { - /* Turn on all multicast addresses. We have to do this for + /* + * Turn on all multicast addresses. We have to do this for * promiscuous mode as well as ALLMCAST mode. It saves the * Microcode from having to keep state about the MAC * configuration. @@ -186,7 +189,8 @@ static void slic_mcast_set_mask(struct adapter *adapter) slic_reg32_write(&slic_regs->slic_mcasthigh, 0xFFFFFFFF, FLUSH); } else { - /* Commit our multicast mast to the SLIC by writing to the + /* + * Commit our multicast mast to the SLIC by writing to the * multicast address mask registers */ slic_reg32_write(&slic_regs->slic_mcastlow, @@ -243,7 +247,8 @@ static void slic_link_config(struct adapter *adapter, if ((linkspeed == LINK_AUTOSPEED) || (linkspeed == LINK_1000MB)) { if (adapter->flags & ADAPT_FLAGS_FIBERMEDIA) { - /* We've got a fiber gigabit interface, and register + /* + * We've got a fiber gigabit interface, and register * 4 is different in fiber mode than in copper mode */ @@ -261,16 +266,22 @@ static void slic_link_config(struct adapter *adapter, PCR_AUTONEG_RST)); slic_reg32_write(wphy, phy_config, FLUSH); } else { /* forced 1000 Mb FD*/ - /* power down phy to break link - this may not work) */ + /* + * power down phy to break link + * this may not work) + */ phy_config = (MIICR_REG_PCR | PCR_POWERDOWN); slic_reg32_write(wphy, phy_config, FLUSH); - /* wait, Marvell says 1 sec, - try to get away with 10 ms */ + /* + * wait, Marvell says 1 sec, + * try to get away with 10 ms + */ mdelay(10); - /* disable auto-neg, set speed/duplex, - soft reset phy, powerup */ + /* + * disable auto-neg, set speed/duplex, + * soft reset phy, powerup + */ phy_config = (MIICR_REG_PCR | (PCR_RESET | PCR_SPEED_1000 | @@ -279,7 +290,8 @@ static void slic_link_config(struct adapter *adapter, } } else { /* copper gigabit */ - /* Auto-Negotiate or 1000 Mb must be auto negotiated + /* + * Auto-Negotiate or 1000 Mb must be auto negotiated * We've got a copper gigabit interface, and * register 4 is different in copper mode than * in fiber mode @@ -291,8 +303,10 @@ static void slic_link_config(struct adapter *adapter, (PAR_ADV100FD | PAR_ADV100HD | PAR_ADV10FD | PAR_ADV10HD)); } else { - /* linkspeed == LINK_1000MB - - don't advertise 10/100 Mb modes */ + /* + * linkspeed == LINK_1000MB - + * don't advertise 10/100 Mb modes + */ phy_advreg = MIICR_REG_4; } /* enable PAUSE frames */ @@ -305,8 +319,10 @@ static void slic_link_config(struct adapter *adapter, slic_reg32_write(wphy, phy_gctlreg, FLUSH); if (adapter->subsysid != SLIC_1GB_CICADA_SUBSYS_ID) { - /* if a Marvell PHY - enable auto crossover */ + /* + * if a Marvell PHY + * enable auto crossover + */ phy_config = (MIICR_REG_16 | (MRV_REG16_XOVERON)); slic_reg32_write(wphy, phy_config, FLUSH); @@ -337,8 +353,10 @@ static void slic_link_config(struct adapter *adapter, duplex = PCR_DUPLEX_FULL; if (adapter->subsysid != SLIC_1GB_CICADA_SUBSYS_ID) { - /* if a Marvell PHY - disable auto crossover */ + /* + * if a Marvell PHY + * disable auto crossover + */ phy_config = (MIICR_REG_16 | (MRV_REG16_XOVEROFF)); slic_reg32_write(wphy, phy_config, FLUSH); } @@ -351,9 +369,11 @@ static void slic_link_config(struct adapter *adapter, mdelay(10); if (adapter->subsysid != SLIC_1GB_CICADA_SUBSYS_ID) { - /* if a Marvell PHY - disable auto-neg, set speed, - soft reset phy, powerup */ + /* + * if a Marvell PHY + * disable auto-neg, set speed, + * soft reset phy, powerup + */ phy_config = (MIICR_REG_PCR | (PCR_RESET | speed | duplex)); slic_reg32_write(wphy, phy_config, FLUSH); @@ -529,11 +549,13 @@ static int slic_card_download(struct adapter *adapter) index += 4; /* Check SRAM location zero. If it is non-zero. Abort.*/ -/* failure = readl((u32 __iomem *)&slic_regs->slic_reset); - if (failure) { - release_firmware(fw); - return -EIO; - }*/ + /* + * failure = readl((u32 __iomem *)&slic_regs->slic_reset); + * if (failure) { + * release_firmware(fw); + * return -EIO; + * } + */ } } release_firmware(fw); @@ -541,8 +563,10 @@ static int slic_card_download(struct adapter *adapter) mdelay(10); slic_reg32_write(&slic_regs->slic_wcs, SLIC_WCS_START, FLUSH); - /* stall for 20 ms, long enough for ucode to init card - and reach mainloop */ + /* + * stall for 20 ms, long enough for ucode to init card + * and reach mainloop + */ mdelay(20); return 0; @@ -591,19 +615,21 @@ static void slic_mac_address_config(struct adapter *adapter) u32 value2; __iomem struct slic_regs *slic_regs = adapter->slic_regs; - value = ntohl(*(__be32 *) &adapter->currmacaddr[2]); + value = ntohl(*(__be32 *)&adapter->currmacaddr[2]); slic_reg32_write(&slic_regs->slic_wraddral, value, FLUSH); slic_reg32_write(&slic_regs->slic_wraddrbl, value, FLUSH); - value2 = (u32) ((adapter->currmacaddr[0] << 8 | + value2 = (u32)((adapter->currmacaddr[0] << 8 | adapter->currmacaddr[1]) & 0xFFFF); slic_reg32_write(&slic_regs->slic_wraddrah, value2, FLUSH); slic_reg32_write(&slic_regs->slic_wraddrbh, value2, FLUSH); - /* Write our multicast mask out to the card. This is done */ - /* here in addition to the slic_mcast_addr_set routine */ - /* because ALL_MCAST may have been enabled or disabled */ + /* + * Write our multicast mask out to the card. This is done + * here in addition to the slic_mcast_addr_set routine + * because ALL_MCAST may have been enabled or disabled + */ slic_mcast_set_mask(adapter); } @@ -884,10 +910,10 @@ static void slic_upr_start(struct adapter *adapter) struct slic_upr *upr; __iomem struct slic_regs *slic_regs = adapter->slic_regs; /* - char * ptr1; - char * ptr2; - uint cmdoffset; -*/ + * char * ptr1; + * char * ptr2; + * uint cmdoffset; + */ upr = adapter->upr_list; if (!upr) return; @@ -969,7 +995,7 @@ static void slic_link_upr_complete(struct adapter *adapter, u32 isr) #else slic_upr_queue_request(adapter, SLIC_UPR_RLSR, - (u32) &pshmem->linkstatus, + (u32)&pshmem->linkstatus, SLIC_GET_ADDR_HIGH(pshmem), 0, 0); #endif return; @@ -1039,7 +1065,7 @@ static void slic_upr_request_complete(struct adapter *adapter, u32 isr) case SLIC_UPR_STATS: { struct slic_stats *slicstats = - (struct slic_stats *) &adapter->pshmem->inicstats; + (struct slic_stats *)&adapter->pshmem->inicstats; struct slic_stats *newstats = slicstats; struct slic_stats *old = &adapter->inicstats_prev; struct slicnet_stats *stst = &adapter->slic_stats; @@ -1145,8 +1171,7 @@ static u16 slic_eeprom_cksum(void *eeprom, unsigned len) } if (len > 0) - checksum += *(u8 *) wp; - + checksum += *(u8 *)wp; while (checksum >> 16) checksum = (checksum & 0xFFFF) + ((checksum >> 16) & 0xFFFF); @@ -1244,7 +1269,7 @@ static void slic_cmdqmem_free(struct adapter *adapter) if (cmdqmem->pages[i]) { pci_free_consistent(adapter->pcidev, PAGE_SIZE, - (void *) cmdqmem->pages[i], + (void *)cmdqmem->pages[i], cmdqmem->dma_pages[i]); } } @@ -1307,7 +1332,7 @@ static void slic_cmdq_addcmdpage(struct adapter *adapter, u32 *page) unsigned long flags; cmdaddr = page; - cmd = (struct slic_hostcmd *)cmdaddr; + cmd = cmdaddr; cmdcnt = 0; phys_addr = virt_to_bus((void *)page); @@ -1324,8 +1349,8 @@ static void slic_cmdq_addcmdpage(struct adapter *adapter, u32 *page) adapter->pfree_slic_handles = pslic_handle->next; spin_unlock_irqrestore(&adapter->handle_lock, flags); pslic_handle->type = SLIC_HANDLE_CMD; - pslic_handle->address = (void *) cmd; - pslic_handle->offset = (ushort) adapter->slic_handle_ix++; + pslic_handle->address = (void *)cmd; + pslic_handle->offset = (ushort)adapter->slic_handle_ix++; pslic_handle->other_handle = NULL; pslic_handle->next = NULL; @@ -1340,7 +1365,7 @@ static void slic_cmdq_addcmdpage(struct adapter *adapter, u32 *page) phys_addrl += SLIC_HOSTCMD_SIZE; cmdaddr += SLIC_HOSTCMD_SIZE; - cmd = (struct slic_hostcmd *)cmdaddr; + cmd = cmdaddr; cmdcnt++; } @@ -1715,14 +1740,14 @@ static u32 slic_rcvqueue_reinsert(struct adapter *adapter, struct sk_buff *skb) * will also complete asynchronously. * */ -static void slic_link_event_handler(struct adapter *adapter) +static int slic_link_event_handler(struct adapter *adapter) { int status; struct slic_shmem *pshmem; if (adapter->state != ADAPT_UP) { /* Adapter is not operational. Ignore. */ - return; + return -ENODEV; } pshmem = (struct slic_shmem *)(unsigned long)adapter->phys_shmem; @@ -1735,9 +1760,10 @@ static void slic_link_event_handler(struct adapter *adapter) 0, 0); #else status = slic_upr_request(adapter, SLIC_UPR_RLSR, - (u32) &pshmem->linkstatus, /* no 4GB wrap guaranteed */ + (u32)&pshmem->linkstatus, /* no 4GB wrap guaranteed */ 0, 0, 0); #endif + return status; } static void slic_init_cleanup(struct adapter *adapter) @@ -1802,7 +1828,7 @@ static void slic_mcast_set_list(struct net_device *dev) struct netdev_hw_addr *ha; netdev_for_each_mc_addr(ha, dev) { - addresses = (char *) &ha->addr; + addresses = (char *)&ha->addr; status = slic_mcast_add_list(adapter, addresses); if (status != 0) break; @@ -1850,8 +1876,8 @@ static void slic_xmit_build_request(struct adapter *adapter, ihcmd->u.slic_buffers.bufs[0].paddrh = SLIC_GET_ADDR_HIGH(phys_addr); ihcmd->u.slic_buffers.bufs[0].length = skb->len; #if BITS_PER_LONG == 64 - hcmd->cmdsize = (u32) ((((u64)&ihcmd->u.slic_buffers.bufs[1] - - (u64) hcmd) + 31) >> 5); + hcmd->cmdsize = (u32)((((u64)&ihcmd->u.slic_buffers.bufs[1] - + (u64)hcmd) + 31) >> 5); #else hcmd->cmdsize = (((u32)&ihcmd->u.slic_buffers.bufs[1] - (u32)hcmd) + 31) >> 5; @@ -2048,11 +2074,10 @@ static void slic_xmit_complete(struct adapter *adapter) adapter->xmit_completes++; adapter->card->events++; /* - Get the complete host command buffer - */ + * Get the complete host command buffer + */ slic_handle_word.handle_token = rspbuf->hosthandle; hcmd = - (struct slic_hostcmd *) adapter->slic_handles[slic_handle_word.handle_index]. address; /* hcmd = (struct slic_hostcmd *) rspbuf->hosthandle; */ @@ -2107,7 +2132,8 @@ static void slic_interrupt_card_up(u32 isr, struct adapter *adapter, if (isr & ISR_LEVENT) { adapter->linkevent_interrupts++; - slic_link_event_handler(adapter); + if (slic_link_event_handler(adapter)) + adapter->linkevent_interrupts--; } if ((isr & ISR_UPC) || (isr & ISR_UPCERR) || @@ -2128,10 +2154,9 @@ static void slic_interrupt_card_up(u32 isr, struct adapter *adapter, } } - static irqreturn_t slic_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *)dev_id; + struct net_device *dev = dev_id; struct adapter *adapter = netdev_priv(dev); u32 isr; @@ -2225,7 +2250,6 @@ xmit_fail: goto xmit_done; } - static void slic_adapter_freeresources(struct adapter *adapter) { slic_init_cleanup(adapter); @@ -2376,7 +2400,22 @@ static int slic_if_init(struct adapter *adapter, unsigned long *flags) slic_reg32_write(&slic_regs->slic_icr, ICR_INT_ON, FLUSH); slic_link_config(adapter, LINK_AUTOSPEED, LINK_AUTOD); - slic_link_event_handler(adapter); + rc = slic_link_event_handler(adapter); + if (rc) { + /* disable interrupts then clear pending events */ + slic_reg32_write(&slic_regs->slic_icr, ICR_INT_OFF, FLUSH); + slic_reg32_write(&slic_regs->slic_isr, 0, FLUSH); + if (adapter->pingtimerset) { + del_timer(&adapter->pingtimer); + adapter->pingtimerset = 0; + } + if (card->loadtimerset) { + del_timer(&card->loadtimer); + card->loadtimerset = 0; + } + adapter->state = ADAPT_DOWN; + slic_adapter_freeresources(adapter); + } err: return rc; @@ -2606,7 +2645,8 @@ static int slic_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) else duplex = 0; slic_link_config(adapter, speed, duplex); - slic_link_event_handler(adapter); + if (slic_link_event_handler(adapter)) + return -EFAULT; } } return 0; @@ -2734,7 +2774,7 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter) /* Oasis card */ case SLIC_2GB_DEVICE_ID: /* extract EEPROM data and pointers to EEPROM data */ - pOeeprom = (struct oslic_eeprom *) peeprom; + pOeeprom = (struct oslic_eeprom *)peeprom; eecodesize = pOeeprom->EecodeSize; dramsize = pOeeprom->DramSize; pmac = pOeeprom->MacInfo; @@ -2743,10 +2783,12 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter) oemfruformat = pOeeprom->OemFruFormat; poemfru = &pOeeprom->OemFru; macaddrs = 2; - /* Minor kludge for Oasis card - get 2 MAC addresses from the - EEPROM to ensure that function 1 - gets the Port 1 MAC address */ + /* + * Minor kludge for Oasis card + * get 2 MAC addresses from the + * EEPROM to ensure that function 1 + * gets the Port 1 MAC address + */ break; default: /* extract EEPROM data and pointers to EEPROM data */ @@ -2767,16 +2809,16 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter) (eecodesize >= MIN_EECODE_SIZE)) { ee_chksum = - *(u16 *) ((char *) peeprom + (eecodesize - 2)); + *(u16 *)((char *)peeprom + (eecodesize - 2)); /* - calculate the EEPROM checksum - */ + * calculate the EEPROM checksum + */ calc_chksum = slic_eeprom_cksum(peeprom, eecodesize - 2); /* - if the ucdoe chksum flag bit worked, - we wouldn't need this - */ + * if the ucdoe chksum flag bit worked, + * we wouldn't need this + */ if (ee_chksum == calc_chksum) card->config.EepromValid = true; } @@ -2861,7 +2903,7 @@ static void slic_init_adapter(struct net_device *netdev, adapter->busnumber = pcidev->bus->number; adapter->slotnumber = ((pcidev->devfn >> 3) & 0x1F); adapter->functionnumber = (pcidev->devfn & 0x7); - adapter->slic_regs = (__iomem struct slic_regs *)memaddr; + adapter->slic_regs = memaddr; adapter->irq = pcidev->irq; /* adapter->netdev = netdev;*/ adapter->chipid = chip_idx; @@ -2875,11 +2917,11 @@ static void slic_init_adapter(struct net_device *netdev, adapter->card_size = 1; /* - Initialize slic_handle array - */ + * Initialize slic_handle array + */ /* - Start with 1. 0 is an invalid host handle. - */ + * Start with 1. 0 is an invalid host handle. + */ for (index = 1, pslic_handle = &adapter->slic_handles[1]; index < SLIC_CMDQ_MAXCMDS; index++, pslic_handle++) { @@ -2930,11 +2972,11 @@ static u32 slic_card_locate(struct adapter *adapter) } hostid_reg = - (u16 __iomem *) (((u8 __iomem *) (adapter->slic_regs)) + + (u16 __iomem *)(((u8 __iomem *)(adapter->slic_regs)) + rdhostid_offset); /* read the 16 bit hostid from SRAM */ - card_hostid = (ushort) readw(hostid_reg); + card_hostid = (ushort)readw(hostid_reg); /* Initialize a new card structure if need be */ if (card_hostid == SLIC_HOSTID_DEFAULT) { @@ -3080,7 +3122,6 @@ static int slic_entry_probe(struct pci_dev *pcidev, mmio_start = pci_resource_start(pcidev, 0); mmio_len = pci_resource_len(pcidev, 0); - /* memmapped_ioaddr = (u32)ioremap_nocache(mmio_start, mmio_len);*/ memmapped_ioaddr = ioremap(mmio_start, mmio_len); if (!memmapped_ioaddr) { @@ -3116,7 +3157,7 @@ static int slic_entry_probe(struct pci_dev *pcidev, slic_adapter_set_hwaddr(adapter); - netdev->base_addr = (unsigned long) memmapped_ioaddr; + netdev->base_addr = (unsigned long)memmapped_ioaddr; netdev->irq = adapter->irq; netdev->netdev_ops = &slic_netdev_ops; -- cgit v1.2.3-54-g00ecf