Lines Matching refs:tp

459 typhoon_hello(struct typhoon *tp)  in typhoon_hello()  argument
461 struct basic_ring *ring = &tp->cmdRing; in typhoon_hello()
468 if (spin_trylock(&tp->command_lock)) { in typhoon_hello()
474 iowrite32(ring->lastWrite, tp->ioaddr + TYPHOON_REG_CMD_READY); in typhoon_hello()
475 spin_unlock(&tp->command_lock); in typhoon_hello()
480 typhoon_process_response(struct typhoon *tp, int resp_size, in typhoon_process_response() argument
483 struct typhoon_indexes *indexes = tp->indexes; in typhoon_process_response()
485 u8 *base = tp->respRing.ringBase; in typhoon_process_response()
516 typhoon_media_status(tp->dev, resp); in typhoon_process_response()
518 typhoon_hello(tp); in typhoon_process_response()
520 netdev_err(tp->dev, in typhoon_process_response()
550 typhoon_num_free_cmd(struct typhoon *tp) in typhoon_num_free_cmd() argument
552 int lastWrite = tp->cmdRing.lastWrite; in typhoon_num_free_cmd()
553 int cmdCleared = le32_to_cpu(tp->indexes->cmdCleared); in typhoon_num_free_cmd()
559 typhoon_num_free_resp(struct typhoon *tp) in typhoon_num_free_resp() argument
561 int respReady = le32_to_cpu(tp->indexes->respReady); in typhoon_num_free_resp()
562 int respCleared = le32_to_cpu(tp->indexes->respCleared); in typhoon_num_free_resp()
575 typhoon_issue_command(struct typhoon *tp, int num_cmd, struct cmd_desc *cmd, in typhoon_issue_command() argument
578 struct typhoon_indexes *indexes = tp->indexes; in typhoon_issue_command()
579 struct basic_ring *ring = &tp->cmdRing; in typhoon_issue_command()
586 spin_lock(&tp->command_lock); in typhoon_issue_command()
588 freeCmd = typhoon_num_free_cmd(tp); in typhoon_issue_command()
589 freeResp = typhoon_num_free_resp(tp); in typhoon_issue_command()
592 netdev_err(tp->dev, "no descs for cmd, had (needed) %d (%d) cmd, %d (%d) resp\n", in typhoon_issue_command()
602 tp->awaiting_resp = 1; in typhoon_issue_command()
628 iowrite32(ring->lastWrite, tp->ioaddr + TYPHOON_REG_CMD_READY); in typhoon_issue_command()
629 typhoon_post_pci_writes(tp->ioaddr); in typhoon_issue_command()
653 got_resp = typhoon_process_response(tp, num_resp, in typhoon_issue_command()
670 if (tp->awaiting_resp) { in typhoon_issue_command()
671 tp->awaiting_resp = 0; in typhoon_issue_command()
682 iowrite32(1, tp->ioaddr + TYPHOON_REG_SELF_INTERRUPT); in typhoon_issue_command()
685 spin_unlock(&tp->command_lock); in typhoon_issue_command()
713 struct typhoon *tp = netdev_priv(dev); in typhoon_start_tx() local
725 txRing = &tp->txLoRing; in typhoon_start_tx()
782 typhoon_tso_fill(skb, txRing, tp->txlo_dma_addr); in typhoon_start_tx()
792 skb_dma = dma_map_single(&tp->tx_pdev->dev, skb->data, in typhoon_start_tx()
803 skb_dma = dma_map_single(&tp->tx_pdev->dev, skb->data, len, in typhoon_start_tx()
821 skb_dma = dma_map_single(&tp->tx_pdev->dev, frag_addr, in typhoon_start_tx()
834 iowrite32(txRing->lastWrite, tp->tx_ioaddr + txRing->writeRegister); in typhoon_start_tx()
860 struct typhoon *tp = netdev_priv(dev); in typhoon_set_rx_mode() local
886 typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_set_rx_mode()
893 typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_set_rx_mode()
897 typhoon_do_get_stats(struct typhoon *tp) in typhoon_do_get_stats() argument
899 struct net_device_stats *stats = &tp->dev->stats; in typhoon_do_get_stats()
900 struct net_device_stats *saved = &tp->stats_saved; in typhoon_do_get_stats()
907 err = typhoon_issue_command(tp, 1, &xp_cmd, 7, xp_resp); in typhoon_do_get_stats()
940 tp->speed = (s->linkStatus & TYPHOON_LINK_100MBPS) ? in typhoon_do_get_stats()
942 tp->duplex = (s->linkStatus & TYPHOON_LINK_FULL_DUPLEX) ? in typhoon_do_get_stats()
951 struct typhoon *tp = netdev_priv(dev); in typhoon_get_stats() local
952 struct net_device_stats *stats = &tp->dev->stats; in typhoon_get_stats()
953 struct net_device_stats *saved = &tp->stats_saved; in typhoon_get_stats()
956 if (tp->card_state == Sleeping) in typhoon_get_stats()
959 if (typhoon_do_get_stats(tp) < 0) { in typhoon_get_stats()
970 struct typhoon *tp = netdev_priv(dev); in typhoon_get_drvinfo() local
971 struct pci_dev *pci_dev = tp->pdev; in typhoon_get_drvinfo()
976 if (tp->card_state == Sleeping) { in typhoon_get_drvinfo()
981 if (typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp) < 0) { in typhoon_get_drvinfo()
1000 struct typhoon *tp = netdev_priv(dev); in typhoon_get_link_ksettings() local
1006 switch (tp->xcvr_select) { in typhoon_get_link_ksettings()
1028 if (tp->capabilities & TYPHOON_FIBER) { in typhoon_get_link_ksettings()
1041 typhoon_do_get_stats(tp); in typhoon_get_link_ksettings()
1042 cmd->base.speed = tp->speed; in typhoon_get_link_ksettings()
1043 cmd->base.duplex = tp->duplex; in typhoon_get_link_ksettings()
1045 if (tp->xcvr_select == TYPHOON_XCVR_AUTONEG) in typhoon_get_link_ksettings()
1062 struct typhoon *tp = netdev_priv(dev); in typhoon_set_link_ksettings() local
1092 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_set_link_ksettings()
1096 tp->xcvr_select = xcvr; in typhoon_set_link_ksettings()
1098 tp->speed = 0xff; /* invalid */ in typhoon_set_link_ksettings()
1099 tp->duplex = 0xff; /* invalid */ in typhoon_set_link_ksettings()
1101 tp->speed = speed; in typhoon_set_link_ksettings()
1102 tp->duplex = cmd->base.duplex; in typhoon_set_link_ksettings()
1112 struct typhoon *tp = netdev_priv(dev); in typhoon_get_wol() local
1116 if (tp->wol_events & TYPHOON_WAKE_LINK_EVENT) in typhoon_get_wol()
1118 if (tp->wol_events & TYPHOON_WAKE_MAGIC_PKT) in typhoon_get_wol()
1126 struct typhoon *tp = netdev_priv(dev); in typhoon_set_wol() local
1131 tp->wol_events = 0; in typhoon_set_wol()
1133 tp->wol_events |= TYPHOON_WAKE_LINK_EVENT; in typhoon_set_wol()
1135 tp->wol_events |= TYPHOON_WAKE_MAGIC_PKT; in typhoon_set_wol()
1182 typhoon_init_interface(struct typhoon *tp) in typhoon_init_interface() argument
1184 struct typhoon_interface *iface = &tp->shared->iface; in typhoon_init_interface()
1187 memset(tp->shared, 0, sizeof(struct typhoon_shared)); in typhoon_init_interface()
1191 shared_dma = tp->shared_dma + shared_offset(indexes); in typhoon_init_interface()
1194 shared_dma = tp->shared_dma + shared_offset(txLo); in typhoon_init_interface()
1198 shared_dma = tp->shared_dma + shared_offset(txHi); in typhoon_init_interface()
1202 shared_dma = tp->shared_dma + shared_offset(rxBuff); in typhoon_init_interface()
1207 shared_dma = tp->shared_dma + shared_offset(rxLo); in typhoon_init_interface()
1211 shared_dma = tp->shared_dma + shared_offset(rxHi); in typhoon_init_interface()
1215 shared_dma = tp->shared_dma + shared_offset(cmd); in typhoon_init_interface()
1219 shared_dma = tp->shared_dma + shared_offset(resp); in typhoon_init_interface()
1223 shared_dma = tp->shared_dma + shared_offset(zeroWord); in typhoon_init_interface()
1226 tp->indexes = &tp->shared->indexes; in typhoon_init_interface()
1227 tp->txLoRing.ringBase = (u8 *) tp->shared->txLo; in typhoon_init_interface()
1228 tp->txHiRing.ringBase = (u8 *) tp->shared->txHi; in typhoon_init_interface()
1229 tp->rxLoRing.ringBase = (u8 *) tp->shared->rxLo; in typhoon_init_interface()
1230 tp->rxHiRing.ringBase = (u8 *) tp->shared->rxHi; in typhoon_init_interface()
1231 tp->rxBuffRing.ringBase = (u8 *) tp->shared->rxBuff; in typhoon_init_interface()
1232 tp->cmdRing.ringBase = (u8 *) tp->shared->cmd; in typhoon_init_interface()
1233 tp->respRing.ringBase = (u8 *) tp->shared->resp; in typhoon_init_interface()
1235 tp->txLoRing.writeRegister = TYPHOON_REG_TX_LO_READY; in typhoon_init_interface()
1236 tp->txHiRing.writeRegister = TYPHOON_REG_TX_HI_READY; in typhoon_init_interface()
1238 tp->txlo_dma_addr = le32_to_cpu(iface->txLoAddr); in typhoon_init_interface()
1239 tp->card_state = Sleeping; in typhoon_init_interface()
1241 tp->offload = TYPHOON_OFFLOAD_IP_CHKSUM | TYPHOON_OFFLOAD_TCP_CHKSUM; in typhoon_init_interface()
1242 tp->offload |= TYPHOON_OFFLOAD_UDP_CHKSUM | TSO_OFFLOAD_ON; in typhoon_init_interface()
1243 tp->offload |= TYPHOON_OFFLOAD_VLAN; in typhoon_init_interface()
1245 spin_lock_init(&tp->command_lock); in typhoon_init_interface()
1252 typhoon_init_rings(struct typhoon *tp) in typhoon_init_rings() argument
1254 memset(tp->indexes, 0, sizeof(struct typhoon_indexes)); in typhoon_init_rings()
1256 tp->txLoRing.lastWrite = 0; in typhoon_init_rings()
1257 tp->txHiRing.lastWrite = 0; in typhoon_init_rings()
1258 tp->rxLoRing.lastWrite = 0; in typhoon_init_rings()
1259 tp->rxHiRing.lastWrite = 0; in typhoon_init_rings()
1260 tp->rxBuffRing.lastWrite = 0; in typhoon_init_rings()
1261 tp->cmdRing.lastWrite = 0; in typhoon_init_rings()
1262 tp->respRing.lastWrite = 0; in typhoon_init_rings()
1264 tp->txLoRing.lastRead = 0; in typhoon_init_rings()
1265 tp->txHiRing.lastRead = 0; in typhoon_init_rings()
1271 typhoon_request_firmware(struct typhoon *tp) in typhoon_request_firmware() argument
1284 err = request_firmware(&typhoon_fw, FIRMWARE_NAME, &tp->pdev->dev); in typhoon_request_firmware()
1286 netdev_err(tp->dev, "Failed to load firmware \"%s\"\n", in typhoon_request_firmware()
1322 netdev_err(tp->dev, "Invalid firmware image\n"); in typhoon_request_firmware()
1329 typhoon_download_firmware(struct typhoon *tp) in typhoon_download_firmware() argument
1331 void __iomem *ioaddr = tp->ioaddr; in typhoon_download_firmware()
1332 struct pci_dev *pdev = tp->pdev; in typhoon_download_firmware()
1359 netdev_err(tp->dev, "no DMA mem for firmware\n"); in typhoon_download_firmware()
1372 netdev_err(tp->dev, "card ready timeout\n"); in typhoon_download_firmware()
1412 netdev_err(tp->dev, "segment ready timeout\n"); in typhoon_download_firmware()
1444 netdev_err(tp->dev, "final segment ready timeout\n"); in typhoon_download_firmware()
1451 netdev_err(tp->dev, "boot ready timeout, status 0x%0x\n", in typhoon_download_firmware()
1469 typhoon_boot_3XP(struct typhoon *tp, u32 initial_status) in typhoon_boot_3XP() argument
1471 void __iomem *ioaddr = tp->ioaddr; in typhoon_boot_3XP()
1474 netdev_err(tp->dev, "boot ready timeout\n"); in typhoon_boot_3XP()
1479 iowrite32(tp->shared_dma, ioaddr + TYPHOON_REG_BOOT_RECORD_ADDR_LO); in typhoon_boot_3XP()
1485 netdev_err(tp->dev, "boot finish timeout (status 0x%x)\n", in typhoon_boot_3XP()
1505 typhoon_clean_tx(struct typhoon *tp, struct transmit_ring *txRing, in typhoon_clean_tx() argument
1529 dma_unmap_single(&tp->pdev->dev, skb_dma, dma_len, in typhoon_clean_tx()
1541 typhoon_tx_complete(struct typhoon *tp, struct transmit_ring *txRing, in typhoon_tx_complete() argument
1548 lastRead = typhoon_clean_tx(tp, txRing, index); in typhoon_tx_complete()
1549 if (netif_queue_stopped(tp->dev) && typhoon_num_free(txRing->lastWrite, in typhoon_tx_complete()
1551 netif_wake_queue(tp->dev); in typhoon_tx_complete()
1558 typhoon_recycle_rx_skb(struct typhoon *tp, u32 idx) in typhoon_recycle_rx_skb() argument
1560 struct typhoon_indexes *indexes = tp->indexes; in typhoon_recycle_rx_skb()
1561 struct rxbuff_ent *rxb = &tp->rxbuffers[idx]; in typhoon_recycle_rx_skb()
1562 struct basic_ring *ring = &tp->rxBuffRing; in typhoon_recycle_rx_skb()
1585 typhoon_alloc_rx_skb(struct typhoon *tp, u32 idx) in typhoon_alloc_rx_skb() argument
1587 struct typhoon_indexes *indexes = tp->indexes; in typhoon_alloc_rx_skb()
1588 struct rxbuff_ent *rxb = &tp->rxbuffers[idx]; in typhoon_alloc_rx_skb()
1589 struct basic_ring *ring = &tp->rxBuffRing; in typhoon_alloc_rx_skb()
1600 skb = netdev_alloc_skb(tp->dev, PKT_BUF_SZ); in typhoon_alloc_rx_skb()
1611 dma_addr = dma_map_single(&tp->pdev->dev, skb->data, PKT_BUF_SZ, in typhoon_alloc_rx_skb()
1631 typhoon_rx(struct typhoon *tp, struct basic_ring *rxRing, volatile __le32 * ready, in typhoon_rx() argument
1651 rxb = &tp->rxbuffers[idx]; in typhoon_rx()
1658 typhoon_recycle_rx_skb(tp, idx); in typhoon_rx()
1665 (new_skb = netdev_alloc_skb(tp->dev, pkt_len + 2)) != NULL) { in typhoon_rx()
1667 dma_sync_single_for_cpu(&tp->pdev->dev, dma_addr, in typhoon_rx()
1670 dma_sync_single_for_device(&tp->pdev->dev, dma_addr, in typhoon_rx()
1674 typhoon_recycle_rx_skb(tp, idx); in typhoon_rx()
1678 dma_unmap_single(&tp->pdev->dev, dma_addr, PKT_BUF_SZ, in typhoon_rx()
1680 typhoon_alloc_rx_skb(tp, idx); in typhoon_rx()
1682 new_skb->protocol = eth_type_trans(new_skb, tp->dev); in typhoon_rx()
1707 typhoon_fill_free_ring(struct typhoon *tp) in typhoon_fill_free_ring() argument
1712 struct rxbuff_ent *rxb = &tp->rxbuffers[i]; in typhoon_fill_free_ring()
1715 if (typhoon_alloc_rx_skb(tp, i) < 0) in typhoon_fill_free_ring()
1723 struct typhoon *tp = container_of(napi, struct typhoon, napi); in typhoon_poll() local
1724 struct typhoon_indexes *indexes = tp->indexes; in typhoon_poll()
1728 if (!tp->awaiting_resp && indexes->respReady != indexes->respCleared) in typhoon_poll()
1729 typhoon_process_response(tp, 0, NULL); in typhoon_poll()
1731 if (le32_to_cpu(indexes->txLoCleared) != tp->txLoRing.lastRead) in typhoon_poll()
1732 typhoon_tx_complete(tp, &tp->txLoRing, &indexes->txLoCleared); in typhoon_poll()
1737 work_done += typhoon_rx(tp, &tp->rxHiRing, &indexes->rxHiReady, in typhoon_poll()
1742 work_done += typhoon_rx(tp, &tp->rxLoRing, &indexes->rxLoReady, in typhoon_poll()
1746 if (le32_to_cpu(indexes->rxBuffCleared) == tp->rxBuffRing.lastWrite) { in typhoon_poll()
1748 typhoon_fill_free_ring(tp); in typhoon_poll()
1754 tp->ioaddr + TYPHOON_REG_INTR_MASK); in typhoon_poll()
1755 typhoon_post_pci_writes(tp->ioaddr); in typhoon_poll()
1765 struct typhoon *tp = netdev_priv(dev); in typhoon_interrupt() local
1766 void __iomem *ioaddr = tp->ioaddr; in typhoon_interrupt()
1775 if (napi_schedule_prep(&tp->napi)) { in typhoon_interrupt()
1778 __napi_schedule(&tp->napi); in typhoon_interrupt()
1786 typhoon_free_rx_rings(struct typhoon *tp) in typhoon_free_rx_rings() argument
1791 struct rxbuff_ent *rxb = &tp->rxbuffers[i]; in typhoon_free_rx_rings()
1793 dma_unmap_single(&tp->pdev->dev, rxb->dma_addr, in typhoon_free_rx_rings()
1802 typhoon_sleep_early(struct typhoon *tp, __le16 events) in typhoon_sleep_early() argument
1804 void __iomem *ioaddr = tp->ioaddr; in typhoon_sleep_early()
1810 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_sleep_early()
1812 netdev_err(tp->dev, "typhoon_sleep(): wake events cmd err %d\n", in typhoon_sleep_early()
1818 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_sleep_early()
1820 netdev_err(tp->dev, "typhoon_sleep(): sleep cmd err %d\n", err); in typhoon_sleep_early()
1830 netif_carrier_off(tp->dev); in typhoon_sleep_early()
1836 typhoon_sleep(struct typhoon *tp, pci_power_t state, __le16 events) in typhoon_sleep() argument
1840 err = typhoon_sleep_early(tp, events); in typhoon_sleep()
1845 pci_enable_wake(tp->pdev, state, 1); in typhoon_sleep()
1846 pci_disable_device(tp->pdev); in typhoon_sleep()
1847 return pci_set_power_state(tp->pdev, state); in typhoon_sleep()
1851 typhoon_wakeup(struct typhoon *tp, int wait_type) in typhoon_wakeup() argument
1853 void __iomem *ioaddr = tp->ioaddr; in typhoon_wakeup()
1861 (tp->capabilities & TYPHOON_WAKEUP_NEEDS_RESET)) in typhoon_wakeup()
1868 typhoon_start_runtime(struct typhoon *tp) in typhoon_start_runtime() argument
1870 struct net_device *dev = tp->dev; in typhoon_start_runtime()
1871 void __iomem *ioaddr = tp->ioaddr; in typhoon_start_runtime()
1875 typhoon_init_rings(tp); in typhoon_start_runtime()
1876 typhoon_fill_free_ring(tp); in typhoon_start_runtime()
1878 err = typhoon_download_firmware(tp); in typhoon_start_runtime()
1880 netdev_err(tp->dev, "cannot load runtime on 3XP\n"); in typhoon_start_runtime()
1884 if (typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_BOOT) < 0) { in typhoon_start_runtime()
1885 netdev_err(tp->dev, "cannot boot 3XP\n"); in typhoon_start_runtime()
1892 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_start_runtime()
1899 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_start_runtime()
1908 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_start_runtime()
1913 xp_cmd.parm1 = tp->xcvr_select; in typhoon_start_runtime()
1914 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_start_runtime()
1920 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_start_runtime()
1925 xp_cmd.parm2 = tp->offload; in typhoon_start_runtime()
1926 xp_cmd.parm3 = tp->offload; in typhoon_start_runtime()
1927 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_start_runtime()
1934 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_start_runtime()
1939 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_start_runtime()
1943 tp->card_state = Running; in typhoon_start_runtime()
1954 typhoon_free_rx_rings(tp); in typhoon_start_runtime()
1955 typhoon_init_rings(tp); in typhoon_start_runtime()
1960 typhoon_stop_runtime(struct typhoon *tp, int wait_type) in typhoon_stop_runtime() argument
1962 struct typhoon_indexes *indexes = tp->indexes; in typhoon_stop_runtime()
1963 struct transmit_ring *txLo = &tp->txLoRing; in typhoon_stop_runtime()
1964 void __iomem *ioaddr = tp->ioaddr; in typhoon_stop_runtime()
1975 typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_stop_runtime()
1987 netdev_err(tp->dev, "halt timed out waiting for Tx to complete\n"); in typhoon_stop_runtime()
1990 typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_stop_runtime()
1995 tp->card_state = Sleeping; in typhoon_stop_runtime()
1997 typhoon_do_get_stats(tp); in typhoon_stop_runtime()
1998 memcpy(&tp->stats_saved, &tp->dev->stats, sizeof(struct net_device_stats)); in typhoon_stop_runtime()
2001 typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_stop_runtime()
2004 netdev_err(tp->dev, "timed out waiting for 3XP to halt\n"); in typhoon_stop_runtime()
2007 netdev_err(tp->dev, "unable to reset 3XP\n"); in typhoon_stop_runtime()
2014 typhoon_clean_tx(tp, &tp->txLoRing, &indexes->txLoCleared); in typhoon_stop_runtime()
2023 struct typhoon *tp = netdev_priv(dev); in typhoon_tx_timeout() local
2025 if (typhoon_reset(tp->ioaddr, WaitNoSleep) < 0) { in typhoon_tx_timeout()
2031 typhoon_clean_tx(tp, &tp->txLoRing, &tp->indexes->txLoCleared); in typhoon_tx_timeout()
2032 typhoon_free_rx_rings(tp); in typhoon_tx_timeout()
2034 if (typhoon_start_runtime(tp) < 0) { in typhoon_tx_timeout()
2044 typhoon_reset(tp->ioaddr, NoWait); in typhoon_tx_timeout()
2051 struct typhoon *tp = netdev_priv(dev); in typhoon_open() local
2054 err = typhoon_request_firmware(tp); in typhoon_open()
2058 pci_set_power_state(tp->pdev, PCI_D0); in typhoon_open()
2059 pci_restore_state(tp->pdev); in typhoon_open()
2061 err = typhoon_wakeup(tp, WaitSleep); in typhoon_open()
2072 napi_enable(&tp->napi); in typhoon_open()
2074 err = typhoon_start_runtime(tp); in typhoon_open()
2076 napi_disable(&tp->napi); in typhoon_open()
2087 if (typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_HOST) < 0) { in typhoon_open()
2089 typhoon_reset(tp->ioaddr, NoWait); in typhoon_open()
2093 if (typhoon_sleep(tp, PCI_D3hot, 0) < 0) in typhoon_open()
2103 struct typhoon *tp = netdev_priv(dev); in typhoon_close() local
2106 napi_disable(&tp->napi); in typhoon_close()
2108 if (typhoon_stop_runtime(tp, WaitSleep) < 0) in typhoon_close()
2114 typhoon_free_rx_rings(tp); in typhoon_close()
2115 typhoon_init_rings(tp); in typhoon_close()
2117 if (typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_HOST) < 0) in typhoon_close()
2120 if (typhoon_sleep(tp, PCI_D3hot, 0) < 0) in typhoon_close()
2130 struct typhoon *tp = netdev_priv(dev); in typhoon_resume() local
2137 if (typhoon_wakeup(tp, WaitNoSleep) < 0) { in typhoon_resume()
2142 if (typhoon_start_runtime(tp) < 0) { in typhoon_resume()
2151 typhoon_reset(tp->ioaddr, NoWait); in typhoon_resume()
2160 struct typhoon *tp = netdev_priv(dev); in typhoon_suspend() local
2169 if (tp->wol_events & TYPHOON_WAKE_MAGIC_PKT) in typhoon_suspend()
2174 if (typhoon_stop_runtime(tp, WaitNoSleep) < 0) { in typhoon_suspend()
2179 typhoon_free_rx_rings(tp); in typhoon_suspend()
2180 typhoon_init_rings(tp); in typhoon_suspend()
2182 if (typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_HOST) < 0) { in typhoon_suspend()
2190 if (typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL) < 0) { in typhoon_suspend()
2197 if (typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL) < 0) { in typhoon_suspend()
2202 if (typhoon_sleep_early(tp, tp->wol_events) < 0) { in typhoon_suspend()
2277 struct typhoon *tp; in typhoon_init_one() local
2287 dev = alloc_etherdev(sizeof(*tp)); in typhoon_init_one()
2365 tp = netdev_priv(dev); in typhoon_init_one()
2366 tp->shared = shared; in typhoon_init_one()
2367 tp->shared_dma = shared_dma; in typhoon_init_one()
2368 tp->pdev = pdev; in typhoon_init_one()
2369 tp->tx_pdev = pdev; in typhoon_init_one()
2370 tp->ioaddr = ioaddr; in typhoon_init_one()
2371 tp->tx_ioaddr = ioaddr; in typhoon_init_one()
2372 tp->dev = dev; in typhoon_init_one()
2394 typhoon_init_interface(tp); in typhoon_init_one()
2395 typhoon_init_rings(tp); in typhoon_init_one()
2397 err = typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_HOST); in typhoon_init_one()
2404 err = typhoon_issue_command(tp, 1, &xp_cmd, 1, xp_resp); in typhoon_init_one()
2423 err = typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp); in typhoon_init_one()
2429 tp->capabilities = typhoon_card_info[card_id].capabilities; in typhoon_init_one()
2430 tp->xcvr_select = TYPHOON_XCVR_AUTONEG; in typhoon_init_one()
2439 tp->capabilities |= TYPHOON_WAKEUP_NEEDS_RESET; in typhoon_init_one()
2441 err = typhoon_sleep(tp, PCI_D3hot, 0); in typhoon_init_one()
2449 netif_napi_add(dev, &tp->napi, typhoon_poll, 16); in typhoon_init_one()
2531 struct typhoon *tp = netdev_priv(dev); in typhoon_remove_one() local
2536 typhoon_reset(tp->ioaddr, NoWait); in typhoon_remove_one()
2537 pci_iounmap(pdev, tp->ioaddr); in typhoon_remove_one()
2539 tp->shared, tp->shared_dma); in typhoon_remove_one()