• Home
  • Raw
  • Download

Lines Matching refs:sdev

78 static unsigned int slic_next_compl_idx(struct slic_device *sdev)  in slic_next_compl_idx()  argument
80 struct slic_stat_queue *stq = &sdev->stq; in slic_next_compl_idx()
102 slic_write(sdev, SLIC_REG_RBAR, lower_32_bits(paddr) | in slic_next_compl_idx()
105 slic_flush_write(sdev); in slic_next_compl_idx()
139 static void slic_start_upr(struct slic_device *sdev, struct slic_upr *upr) in slic_start_upr() argument
145 slic_write(sdev, reg, lower_32_bits(upr->paddr)); in slic_start_upr()
146 slic_flush_write(sdev); in slic_start_upr()
149 static void slic_queue_upr(struct slic_device *sdev, struct slic_upr *upr) in slic_queue_upr() argument
151 struct slic_upr_list *upr_list = &sdev->upr_list; in slic_queue_upr()
162 slic_start_upr(sdev, upr); in slic_queue_upr()
165 static struct slic_upr *slic_dequeue_upr(struct slic_device *sdev) in slic_dequeue_upr() argument
167 struct slic_upr_list *upr_list = &sdev->upr_list; in slic_dequeue_upr()
185 slic_start_upr(sdev, next_upr); in slic_dequeue_upr()
190 static int slic_new_upr(struct slic_device *sdev, unsigned int type, in slic_new_upr() argument
201 slic_queue_upr(sdev, upr); in slic_new_upr()
222 static void slic_configure_rcv(struct slic_device *sdev) in slic_configure_rcv() argument
229 if (sdev->duplex == DUPLEX_FULL) in slic_configure_rcv()
232 if (sdev->promisc) in slic_configure_rcv()
235 slic_write(sdev, SLIC_REG_WRCFG, val); in slic_configure_rcv()
239 static void slic_configure_xmt(struct slic_device *sdev) in slic_configure_xmt() argument
245 if (sdev->duplex == DUPLEX_FULL) in slic_configure_xmt()
248 slic_write(sdev, SLIC_REG_WXCFG, val); in slic_configure_xmt()
252 static void slic_configure_mac(struct slic_device *sdev) in slic_configure_mac() argument
256 if (sdev->speed == SPEED_1000) { in slic_configure_mac()
267 if (sdev->duplex == DUPLEX_FULL) in slic_configure_mac()
270 slic_write(sdev, SLIC_REG_WMCFG, val); in slic_configure_mac()
273 static void slic_configure_link_locked(struct slic_device *sdev, int speed, in slic_configure_link_locked() argument
276 struct net_device *dev = sdev->netdev; in slic_configure_link_locked()
278 if (sdev->speed == speed && sdev->duplex == duplex) in slic_configure_link_locked()
281 sdev->speed = speed; in slic_configure_link_locked()
282 sdev->duplex = duplex; in slic_configure_link_locked()
284 if (sdev->speed == SPEED_UNKNOWN) { in slic_configure_link_locked()
289 slic_configure_mac(sdev); in slic_configure_link_locked()
290 slic_configure_xmt(sdev); in slic_configure_link_locked()
291 slic_configure_rcv(sdev); in slic_configure_link_locked()
292 slic_flush_write(sdev); in slic_configure_link_locked()
299 static void slic_configure_link(struct slic_device *sdev, int speed, in slic_configure_link() argument
302 spin_lock_bh(&sdev->link_lock); in slic_configure_link()
303 slic_configure_link_locked(sdev, speed, duplex); in slic_configure_link()
304 spin_unlock_bh(&sdev->link_lock); in slic_configure_link()
309 struct slic_device *sdev = netdev_priv(dev); in slic_set_rx_mode() local
329 slic_write(sdev, SLIC_REG_MCASTLOW, lower_32_bits(mcmask)); in slic_set_rx_mode()
330 slic_write(sdev, SLIC_REG_MCASTHIGH, upper_32_bits(mcmask)); in slic_set_rx_mode()
334 spin_lock_bh(&sdev->link_lock); in slic_set_rx_mode()
335 if (sdev->promisc != set_promisc) { in slic_set_rx_mode()
336 sdev->promisc = set_promisc; in slic_set_rx_mode()
337 slic_configure_rcv(sdev); in slic_set_rx_mode()
339 spin_unlock_bh(&sdev->link_lock); in slic_set_rx_mode()
342 static void slic_xmit_complete(struct slic_device *sdev) in slic_xmit_complete() argument
344 struct slic_tx_queue *txq = &sdev->txq; in slic_xmit_complete()
345 struct net_device *dev = sdev->netdev; in slic_xmit_complete()
355 idx = slic_next_compl_idx(sdev); in slic_xmit_complete()
367 dma_unmap_single(&sdev->pdev->dev, in slic_xmit_complete()
380 u64_stats_update_begin(&sdev->stats.syncp); in slic_xmit_complete()
381 sdev->stats.tx_bytes += bytes; in slic_xmit_complete()
382 sdev->stats.tx_packets += frames; in slic_xmit_complete()
383 u64_stats_update_end(&sdev->stats.syncp); in slic_xmit_complete()
392 static void slic_refill_rx_queue(struct slic_device *sdev, gfp_t gfp) in slic_refill_rx_queue() argument
396 struct slic_rx_queue *rxq = &sdev->rxq; in slic_refill_rx_queue()
397 struct net_device *dev = sdev->netdev; in slic_refill_rx_queue()
410 paddr = dma_map_single(&sdev->pdev->dev, skb->data, maplen, in slic_refill_rx_queue()
412 if (dma_mapping_error(&sdev->pdev->dev, paddr)) { in slic_refill_rx_queue()
428 dma_sync_single_for_cpu(&sdev->pdev->dev, paddr, in slic_refill_rx_queue()
433 dma_sync_single_for_device(&sdev->pdev->dev, paddr, in slic_refill_rx_queue()
445 slic_write(sdev, SLIC_REG_HBAR, lower_32_bits(paddr) + offset); in slic_refill_rx_queue()
450 static void slic_handle_frame_error(struct slic_device *sdev, in slic_handle_frame_error() argument
453 struct slic_stats *stats = &sdev->stats; in slic_handle_frame_error()
455 if (sdev->model == SLIC_MODEL_OASIS) { in slic_handle_frame_error()
546 static void slic_handle_receive(struct slic_device *sdev, unsigned int todo, in slic_handle_receive() argument
549 struct slic_rx_queue *rxq = &sdev->rxq; in slic_handle_receive()
550 struct net_device *dev = sdev->netdev; in slic_handle_receive()
568 dma_sync_single_for_cpu(&sdev->pdev->dev, in slic_handle_receive()
575 dma_sync_single_for_device(&sdev->pdev->dev, in slic_handle_receive()
586 dma_unmap_single(&sdev->pdev->dev, in slic_handle_receive()
595 slic_handle_frame_error(sdev, skb); in slic_handle_receive()
601 SLIC_INC_STATS_COUNTER(&sdev->stats, rx_mcasts); in slic_handle_receive()
608 napi_gro_receive(&sdev->napi, skb); in slic_handle_receive()
617 u64_stats_update_begin(&sdev->stats.syncp); in slic_handle_receive()
618 sdev->stats.rx_bytes += bytes; in slic_handle_receive()
619 sdev->stats.rx_packets += frames; in slic_handle_receive()
620 u64_stats_update_end(&sdev->stats.syncp); in slic_handle_receive()
622 slic_refill_rx_queue(sdev, GFP_ATOMIC); in slic_handle_receive()
625 static void slic_handle_link_irq(struct slic_device *sdev) in slic_handle_link_irq() argument
627 struct slic_shmem *sm = &sdev->shmem; in slic_handle_link_irq()
649 slic_configure_link(sdev, speed, duplex); in slic_handle_link_irq()
652 static void slic_handle_upr_irq(struct slic_device *sdev, u32 irqs) in slic_handle_upr_irq() argument
657 upr = slic_dequeue_upr(sdev); in slic_handle_upr_irq()
659 netdev_warn(sdev->netdev, "no upr found on list\n"); in slic_handle_upr_irq()
666 slic_queue_upr(sdev, upr); in slic_handle_upr_irq()
669 slic_handle_link_irq(sdev); in slic_handle_upr_irq()
674 static int slic_handle_link_change(struct slic_device *sdev) in slic_handle_link_change() argument
676 return slic_new_upr(sdev, SLIC_UPR_LSTAT, sdev->shmem.link_paddr); in slic_handle_link_change()
679 static void slic_handle_err_irq(struct slic_device *sdev, u32 isr) in slic_handle_err_irq() argument
681 struct slic_stats *stats = &sdev->stats; in slic_handle_err_irq()
691 static void slic_handle_irq(struct slic_device *sdev, u32 isr, in slic_handle_irq() argument
695 slic_handle_err_irq(sdev, isr); in slic_handle_irq()
698 slic_handle_link_change(sdev); in slic_handle_irq()
701 slic_handle_upr_irq(sdev, isr); in slic_handle_irq()
704 slic_handle_receive(sdev, todo, done); in slic_handle_irq()
707 slic_xmit_complete(sdev); in slic_handle_irq()
712 struct slic_device *sdev = container_of(napi, struct slic_device, napi); in slic_poll() local
713 struct slic_shmem *sm = &sdev->shmem; in slic_poll()
718 slic_handle_irq(sdev, isr, todo, &done); in slic_poll()
726 slic_write(sdev, SLIC_REG_ISR, 0); in slic_poll()
727 slic_flush_write(sdev); in slic_poll()
735 struct slic_device *sdev = dev_id; in slic_irq() local
736 struct slic_shmem *sm = &sdev->shmem; in slic_irq()
739 slic_write(sdev, SLIC_REG_ICR, SLIC_ICR_INT_MASK); in slic_irq()
740 slic_flush_write(sdev); in slic_irq()
747 slic_write(sdev, SLIC_REG_ISR, 0); in slic_irq()
748 slic_flush_write(sdev); in slic_irq()
752 napi_schedule_irqoff(&sdev->napi); in slic_irq()
757 static void slic_card_reset(struct slic_device *sdev) in slic_card_reset() argument
761 slic_write(sdev, SLIC_REG_RESET, SLIC_RESET_MAGIC); in slic_card_reset()
763 pci_read_config_word(sdev->pdev, PCI_COMMAND, &cmd); in slic_card_reset()
767 static int slic_init_stat_queue(struct slic_device *sdev) in slic_init_stat_queue() argument
770 struct slic_stat_queue *stq = &sdev->stq; in slic_init_stat_queue()
786 descs = dma_alloc_coherent(&sdev->pdev->dev, size, &paddr, in slic_init_stat_queue()
789 netdev_err(sdev->netdev, in slic_init_stat_queue()
803 slic_write(sdev, SLIC_REG_RBAR, lower_32_bits(paddr) | in slic_init_stat_queue()
816 dma_free_coherent(&sdev->pdev->dev, stq->mem_size, in slic_init_stat_queue()
824 static void slic_free_stat_queue(struct slic_device *sdev) in slic_free_stat_queue() argument
826 struct slic_stat_queue *stq = &sdev->stq; in slic_free_stat_queue()
830 dma_free_coherent(&sdev->pdev->dev, stq->mem_size, in slic_free_stat_queue()
836 static int slic_init_tx_queue(struct slic_device *sdev) in slic_init_tx_queue() argument
838 struct slic_tx_queue *txq = &sdev->txq; in slic_init_tx_queue()
852 txq->dma_pool = dma_pool_create("slic_pool", &sdev->pdev->dev, in slic_init_tx_queue()
857 netdev_err(sdev->netdev, "failed to create dma pool\n"); in slic_init_tx_queue()
866 netdev_err(sdev->netdev, in slic_init_tx_queue()
894 static void slic_free_tx_queue(struct slic_device *sdev) in slic_free_tx_queue() argument
896 struct slic_tx_queue *txq = &sdev->txq; in slic_free_tx_queue()
906 dma_unmap_single(&sdev->pdev->dev, in slic_free_tx_queue()
916 static int slic_init_rx_queue(struct slic_device *sdev) in slic_init_rx_queue() argument
918 struct slic_rx_queue *rxq = &sdev->rxq; in slic_init_rx_queue()
930 slic_refill_rx_queue(sdev, GFP_KERNEL); in slic_init_rx_queue()
935 static void slic_free_rx_queue(struct slic_device *sdev) in slic_free_rx_queue() argument
937 struct slic_rx_queue *rxq = &sdev->rxq; in slic_free_rx_queue()
948 dma_unmap_single(&sdev->pdev->dev, in slic_free_rx_queue()
957 static void slic_set_link_autoneg(struct slic_device *sdev) in slic_set_link_autoneg() argument
959 unsigned int subid = sdev->pdev->subsystem_device; in slic_set_link_autoneg()
962 if (sdev->is_fiber) { in slic_set_link_autoneg()
970 slic_write(sdev, SLIC_REG_WPHY, val); in slic_set_link_autoneg()
974 slic_write(sdev, SLIC_REG_WPHY, val); in slic_set_link_autoneg()
986 slic_write(sdev, SLIC_REG_WPHY, val); in slic_set_link_autoneg()
990 slic_write(sdev, SLIC_REG_WPHY, val); in slic_set_link_autoneg()
995 slic_write(sdev, SLIC_REG_WPHY, val); in slic_set_link_autoneg()
1000 slic_write(sdev, SLIC_REG_WPHY, val); in slic_set_link_autoneg()
1004 slic_write(sdev, SLIC_REG_WPHY, val); in slic_set_link_autoneg()
1009 static void slic_set_mac_address(struct slic_device *sdev) in slic_set_mac_address() argument
1011 u8 *addr = sdev->netdev->dev_addr; in slic_set_mac_address()
1016 slic_write(sdev, SLIC_REG_WRADDRAL, val); in slic_set_mac_address()
1017 slic_write(sdev, SLIC_REG_WRADDRBL, val); in slic_set_mac_address()
1021 slic_write(sdev, SLIC_REG_WRADDRAH, val); in slic_set_mac_address()
1022 slic_write(sdev, SLIC_REG_WRADDRBH, val); in slic_set_mac_address()
1023 slic_flush_write(sdev); in slic_set_mac_address()
1041 static int slic_load_rcvseq_firmware(struct slic_device *sdev) in slic_load_rcvseq_firmware() argument
1051 file = (sdev->model == SLIC_MODEL_OASIS) ? SLIC_RCV_FIRMWARE_OASIS : in slic_load_rcvseq_firmware()
1053 err = request_firmware(&fw, file, &sdev->pdev->dev); in slic_load_rcvseq_firmware()
1055 dev_err(&sdev->pdev->dev, in slic_load_rcvseq_firmware()
1063 dev_err(&sdev->pdev->dev, in slic_load_rcvseq_firmware()
1074 dev_err(&sdev->pdev->dev, in slic_load_rcvseq_firmware()
1081 slic_write(sdev, SLIC_REG_RCV_WCS, SLIC_RCVWCS_BEGIN); in slic_load_rcvseq_firmware()
1085 slic_write(sdev, SLIC_REG_RCV_WCS, addr); in slic_load_rcvseq_firmware()
1089 slic_write(sdev, SLIC_REG_RCV_WCS, instr); in slic_load_rcvseq_firmware()
1095 slic_write(sdev, SLIC_REG_RCV_WCS, instr); in slic_load_rcvseq_firmware()
1098 slic_write(sdev, SLIC_REG_RCV_WCS, SLIC_RCVWCS_FINISH); in slic_load_rcvseq_firmware()
1099 slic_flush_write(sdev); in slic_load_rcvseq_firmware()
1109 static int slic_load_firmware(struct slic_device *sdev) in slic_load_firmware() argument
1126 file = (sdev->model == SLIC_MODEL_OASIS) ? SLIC_FIRMWARE_OASIS : in slic_load_firmware()
1128 err = request_firmware(&fw, file, &sdev->pdev->dev); in slic_load_firmware()
1130 dev_err(&sdev->pdev->dev, "failed to load firmware %s\n", file); in slic_load_firmware()
1137 dev_err(&sdev->pdev->dev, in slic_load_firmware()
1146 dev_err(&sdev->pdev->dev, in slic_load_firmware()
1160 dev_err(&sdev->pdev->dev, in slic_load_firmware()
1180 slic_write(sdev, SLIC_REG_WCS, base + addr); in slic_load_firmware()
1182 slic_write(sdev, SLIC_REG_WCS, instr); in slic_load_firmware()
1185 slic_write(sdev, SLIC_REG_WCS, instr); in slic_load_firmware()
1202 slic_write(sdev, SLIC_REG_WCS, in slic_load_firmware()
1205 slic_write(sdev, SLIC_REG_WCS, instr); in slic_load_firmware()
1208 slic_write(sdev, SLIC_REG_WCS, instr); in slic_load_firmware()
1212 slic_flush_write(sdev); in slic_load_firmware()
1215 slic_write(sdev, SLIC_REG_WCS, SLIC_WCS_START); in slic_load_firmware()
1216 slic_flush_write(sdev); in slic_load_firmware()
1225 static int slic_init_shmem(struct slic_device *sdev) in slic_init_shmem() argument
1227 struct slic_shmem *sm = &sdev->shmem; in slic_init_shmem()
1231 sm_data = dma_alloc_coherent(&sdev->pdev->dev, sizeof(*sm_data), in slic_init_shmem()
1234 dev_err(&sdev->pdev->dev, "failed to allocate shared memory\n"); in slic_init_shmem()
1245 static void slic_free_shmem(struct slic_device *sdev) in slic_free_shmem() argument
1247 struct slic_shmem *sm = &sdev->shmem; in slic_free_shmem()
1250 dma_free_coherent(&sdev->pdev->dev, sizeof(*sm_data), sm_data, in slic_free_shmem()
1254 static int slic_init_iface(struct slic_device *sdev) in slic_init_iface() argument
1256 struct slic_shmem *sm = &sdev->shmem; in slic_init_iface()
1259 sdev->upr_list.pending = false; in slic_init_iface()
1261 err = slic_init_shmem(sdev); in slic_init_iface()
1263 netdev_err(sdev->netdev, "failed to init shared memory\n"); in slic_init_iface()
1267 err = slic_load_firmware(sdev); in slic_init_iface()
1269 netdev_err(sdev->netdev, "failed to load firmware\n"); in slic_init_iface()
1273 err = slic_load_rcvseq_firmware(sdev); in slic_init_iface()
1275 netdev_err(sdev->netdev, in slic_init_iface()
1280 slic_write(sdev, SLIC_REG_ICR, SLIC_ICR_INT_OFF); in slic_init_iface()
1281 slic_flush_write(sdev); in slic_init_iface()
1284 err = slic_init_rx_queue(sdev); in slic_init_iface()
1286 netdev_err(sdev->netdev, "failed to init rx queue: %u\n", err); in slic_init_iface()
1290 err = slic_init_tx_queue(sdev); in slic_init_iface()
1292 netdev_err(sdev->netdev, "failed to init tx queue: %u\n", err); in slic_init_iface()
1296 err = slic_init_stat_queue(sdev); in slic_init_iface()
1298 netdev_err(sdev->netdev, "failed to init status queue: %u\n", in slic_init_iface()
1303 slic_write(sdev, SLIC_REG_ISP, lower_32_bits(sm->isr_paddr)); in slic_init_iface()
1304 napi_enable(&sdev->napi); in slic_init_iface()
1306 slic_write(sdev, SLIC_REG_INTAGG, 0); in slic_init_iface()
1307 slic_write(sdev, SLIC_REG_ISR, 0); in slic_init_iface()
1308 slic_flush_write(sdev); in slic_init_iface()
1310 slic_set_mac_address(sdev); in slic_init_iface()
1312 spin_lock_bh(&sdev->link_lock); in slic_init_iface()
1313 sdev->duplex = DUPLEX_UNKNOWN; in slic_init_iface()
1314 sdev->speed = SPEED_UNKNOWN; in slic_init_iface()
1315 spin_unlock_bh(&sdev->link_lock); in slic_init_iface()
1317 slic_set_link_autoneg(sdev); in slic_init_iface()
1319 err = request_irq(sdev->pdev->irq, slic_irq, IRQF_SHARED, DRV_NAME, in slic_init_iface()
1320 sdev); in slic_init_iface()
1322 netdev_err(sdev->netdev, "failed to request irq: %u\n", err); in slic_init_iface()
1326 slic_write(sdev, SLIC_REG_ICR, SLIC_ICR_INT_ON); in slic_init_iface()
1327 slic_flush_write(sdev); in slic_init_iface()
1329 err = slic_handle_link_change(sdev); in slic_init_iface()
1331 netdev_warn(sdev->netdev, in slic_init_iface()
1336 napi_disable(&sdev->napi); in slic_init_iface()
1337 slic_free_stat_queue(sdev); in slic_init_iface()
1339 slic_free_tx_queue(sdev); in slic_init_iface()
1341 slic_free_rx_queue(sdev); in slic_init_iface()
1343 slic_free_shmem(sdev); in slic_init_iface()
1344 slic_card_reset(sdev); in slic_init_iface()
1351 struct slic_device *sdev = netdev_priv(dev); in slic_open() local
1356 err = slic_init_iface(sdev); in slic_open()
1369 struct slic_device *sdev = netdev_priv(dev); in slic_close() local
1375 napi_disable(&sdev->napi); in slic_close()
1376 slic_write(sdev, SLIC_REG_ICR, SLIC_ICR_INT_OFF); in slic_close()
1377 slic_write(sdev, SLIC_REG_ISR, 0); in slic_close()
1378 slic_flush_write(sdev); in slic_close()
1380 free_irq(sdev->pdev->irq, sdev); in slic_close()
1383 slic_write(sdev, SLIC_REG_WXCFG, val); in slic_close()
1387 slic_write(sdev, SLIC_REG_WRCFG, val); in slic_close()
1390 slic_write(sdev, SLIC_REG_WPHY, val); in slic_close()
1391 slic_flush_write(sdev); in slic_close()
1393 slic_clear_upr_list(&sdev->upr_list); in slic_close()
1394 slic_write(sdev, SLIC_REG_QUIESCE, 0); in slic_close()
1396 slic_free_stat_queue(sdev); in slic_close()
1397 slic_free_tx_queue(sdev); in slic_close()
1398 slic_free_rx_queue(sdev); in slic_close()
1399 slic_free_shmem(sdev); in slic_close()
1401 slic_card_reset(sdev); in slic_close()
1409 struct slic_device *sdev = netdev_priv(dev); in slic_xmit() local
1410 struct slic_tx_queue *txq = &sdev->txq; in slic_xmit()
1424 paddr = dma_map_single(&sdev->pdev->dev, skb->data, maplen, in slic_xmit()
1426 if (dma_mapping_error(&sdev->pdev->dev, paddr)) { in slic_xmit()
1448 slic_write(sdev, SLIC_REG_CBAR, cbar_val); in slic_xmit()
1463 struct slic_device *sdev = netdev_priv(dev); in slic_get_stats() local
1464 struct slic_stats *stats = &sdev->stats; in slic_get_stats()
1493 struct slic_device *sdev = netdev_priv(dev); in slic_get_ethtool_stats() local
1494 struct slic_stats *stats = &sdev->stats; in slic_get_ethtool_stats()
1532 struct slic_device *sdev = netdev_priv(dev); in slic_get_drvinfo() local
1535 strlcpy(info->bus_info, pci_name(sdev->pdev), sizeof(info->bus_info)); in slic_get_drvinfo()
1595 static int slic_read_eeprom(struct slic_device *sdev) in slic_read_eeprom() argument
1597 unsigned int devfn = PCI_FUNC(sdev->pdev->devfn); in slic_read_eeprom()
1598 struct slic_shmem *sm = &sdev->shmem; in slic_read_eeprom()
1609 eeprom = dma_alloc_coherent(&sdev->pdev->dev, SLIC_EEPROM_SIZE, in slic_read_eeprom()
1614 slic_write(sdev, SLIC_REG_ICR, SLIC_ICR_INT_OFF); in slic_read_eeprom()
1616 slic_write(sdev, SLIC_REG_ISP, lower_32_bits(sm->isr_paddr)); in slic_read_eeprom()
1618 err = slic_new_upr(sdev, SLIC_UPR_CONFIG, paddr); in slic_read_eeprom()
1626 dev_err(&sdev->pdev->dev, in slic_read_eeprom()
1630 upr = slic_dequeue_upr(sdev); in slic_read_eeprom()
1634 slic_write(sdev, SLIC_REG_ISP, 0); in slic_read_eeprom()
1635 slic_write(sdev, SLIC_REG_ISR, 0); in slic_read_eeprom()
1636 slic_flush_write(sdev); in slic_read_eeprom()
1641 if (sdev->model == SLIC_MODEL_OASIS) { in slic_read_eeprom()
1658 dev_err(&sdev->pdev->dev, "invalid checksum in eeprom\n"); in slic_read_eeprom()
1663 ether_addr_copy(sdev->netdev->dev_addr, mac[devfn]); in slic_read_eeprom()
1665 dma_free_coherent(&sdev->pdev->dev, SLIC_EEPROM_SIZE, eeprom, paddr); in slic_read_eeprom()
1670 static int slic_init(struct slic_device *sdev) in slic_init() argument
1674 spin_lock_init(&sdev->upper_lock); in slic_init()
1675 spin_lock_init(&sdev->link_lock); in slic_init()
1676 INIT_LIST_HEAD(&sdev->upr_list.list); in slic_init()
1677 spin_lock_init(&sdev->upr_list.lock); in slic_init()
1678 u64_stats_init(&sdev->stats.syncp); in slic_init()
1680 slic_card_reset(sdev); in slic_init()
1682 err = slic_load_firmware(sdev); in slic_init()
1684 dev_err(&sdev->pdev->dev, "failed to load firmware\n"); in slic_init()
1689 err = slic_init_shmem(sdev); in slic_init()
1691 dev_err(&sdev->pdev->dev, "failed to init shared memory\n"); in slic_init()
1695 err = slic_read_eeprom(sdev); in slic_init()
1697 dev_err(&sdev->pdev->dev, "failed to read eeprom\n"); in slic_init()
1701 slic_card_reset(sdev); in slic_init()
1702 slic_free_shmem(sdev); in slic_init()
1706 slic_free_shmem(sdev); in slic_init()
1741 struct slic_device *sdev; in slic_probe() local
1770 dev = alloc_etherdev(sizeof(*sdev)); in slic_probe()
1786 sdev = netdev_priv(dev); in slic_probe()
1787 sdev->model = (pdev->device == PCI_DEVICE_ID_ALACRITECH_OASIS) ? in slic_probe()
1789 sdev->is_fiber = slic_is_fiber(pdev->subsystem_device); in slic_probe()
1790 sdev->pdev = pdev; in slic_probe()
1791 sdev->netdev = dev; in slic_probe()
1792 sdev->regs = ioremap(pci_resource_start(pdev, 0), in slic_probe()
1794 if (!sdev->regs) { in slic_probe()
1800 err = slic_init(sdev); in slic_probe()
1806 netif_napi_add(dev, &sdev->napi, slic_poll, SLIC_NAPI_WEIGHT); in slic_probe()
1818 iounmap(sdev->regs); in slic_probe()
1832 struct slic_device *sdev = netdev_priv(dev); in slic_remove() local
1835 iounmap(sdev->regs); in slic_remove()