Lines Matching refs:fp

212 static inline void fza_regs_dump(struct fza_private *fp)  in fza_regs_dump()  argument
214 pr_debug("%s: iomem registers:\n", fp->name); in fza_regs_dump()
215 pr_debug(" reset: 0x%04x\n", readw_o(&fp->regs->reset)); in fza_regs_dump()
216 pr_debug(" interrupt event: 0x%04x\n", readw_u(&fp->regs->int_event)); in fza_regs_dump()
217 pr_debug(" status: 0x%04x\n", readw_u(&fp->regs->status)); in fza_regs_dump()
218 pr_debug(" interrupt mask: 0x%04x\n", readw_u(&fp->regs->int_mask)); in fza_regs_dump()
219 pr_debug(" control A: 0x%04x\n", readw_u(&fp->regs->control_a)); in fza_regs_dump()
220 pr_debug(" control B: 0x%04x\n", readw_u(&fp->regs->control_b)); in fza_regs_dump()
223 static inline void fza_do_reset(struct fza_private *fp) in fza_do_reset() argument
226 writew_o(FZA_RESET_INIT, &fp->regs->reset); in fza_do_reset()
227 readw_o(&fp->regs->reset); /* Synchronize. */ in fza_do_reset()
228 readw_o(&fp->regs->reset); /* Read it back for a small delay. */ in fza_do_reset()
229 writew_o(FZA_RESET_CLR, &fp->regs->reset); in fza_do_reset()
232 writew_o(fp->int_mask, &fp->regs->int_mask); in fza_do_reset()
233 readw_o(&fp->regs->int_mask); /* Synchronize. */ in fza_do_reset()
236 static inline void fza_do_shutdown(struct fza_private *fp) in fza_do_shutdown() argument
239 writew_o(FZA_CONTROL_B_IDLE, &fp->regs->control_b); in fza_do_shutdown()
242 writew_o(FZA_RESET_INIT, &fp->regs->reset); in fza_do_shutdown()
243 readw_o(&fp->regs->reset); /* Synchronize. */ in fza_do_shutdown()
244 writew_o(FZA_RESET_CLR, &fp->regs->reset); in fza_do_shutdown()
245 readw_o(&fp->regs->reset); /* Synchronize. */ in fza_do_shutdown()
248 static int fza_reset(struct fza_private *fp) in fza_reset() argument
254 pr_info("%s: resetting the board...\n", fp->name); in fza_reset()
256 spin_lock_irqsave(&fp->lock, flags); in fza_reset()
257 fp->state_chg_flag = 0; in fza_reset()
258 fza_do_reset(fp); in fza_reset()
259 spin_unlock_irqrestore(&fp->lock, flags); in fza_reset()
265 t = wait_event_timeout(fp->state_chg_wait, fp->state_chg_flag, in fza_reset()
267 status = readw_u(&fp->regs->status); in fza_reset()
269 if (fp->state_chg_flag == 0) { in fza_reset()
270 pr_err("%s: RESET timed out!, state %x\n", fp->name, state); in fza_reset()
275 fp->name, state, FZA_STATUS_GET_TEST(status)); in fza_reset()
278 pr_info("%s: OK\n", fp->name); in fza_reset()
279 pr_debug("%s: RESET: %lums elapsed\n", fp->name, in fza_reset()
288 struct fza_private *fp = netdev_priv(dev); in fza_cmd_send() local
289 struct fza_ring_cmd __iomem *ring = fp->ring_cmd + fp->ring_cmd_index; in fza_cmd_send()
295 old_mask = fp->int_mask; in fza_cmd_send()
297 writew_u(new_mask, &fp->regs->int_mask); in fza_cmd_send()
298 readw_o(&fp->regs->int_mask); /* Synchronize. */ in fza_cmd_send()
299 fp->int_mask = new_mask; in fza_cmd_send()
301 buf = fp->mmio + readl_u(&ring->buffer); in fza_cmd_send()
305 pr_warn("%s: command buffer full, command: %u!\n", fp->name, in fza_cmd_send()
336 writel_u(fp->t_max, &buf->param.t_max); in fza_cmd_send()
337 writel_u(fp->t_req, &buf->param.t_req); in fza_cmd_send()
338 writel_u(fp->tvx, &buf->param.tvx); in fza_cmd_send()
339 writel_u(fp->lem_threshold, &buf->param.lem_threshold); in fza_cmd_send()
340 fza_writes(&fp->station_id, &buf->param.station_id, in fza_cmd_send()
343 writel_u(fp->rtoken_timeout / 12500, in fza_cmd_send()
345 writel_u(fp->ring_purger, &buf->param.ring_purger); in fza_cmd_send()
367 writew_o(FZA_CONTROL_A_CMD_POLL, &fp->regs->control_a); in fza_cmd_send()
369 fp->ring_cmd_index = (fp->ring_cmd_index + 1) % FZA_RING_CMD_SIZE; in fza_cmd_send()
371 fp->int_mask = old_mask; in fza_cmd_send()
372 writew_u(fp->int_mask, &fp->regs->int_mask); in fza_cmd_send()
380 struct fza_private *fp = netdev_priv(dev); in fza_init_send() local
386 spin_lock_irqsave(&fp->lock, flags); in fza_init_send()
387 fp->cmd_done_flag = 0; in fza_init_send()
389 spin_unlock_irqrestore(&fp->lock, flags); in fza_init_send()
397 t = wait_event_timeout(fp->cmd_done_wait, fp->cmd_done_flag, 3 * HZ); in fza_init_send()
398 if (fp->cmd_done_flag == 0) { in fza_init_send()
399 pr_err("%s: INIT command timed out!, state %x\n", fp->name, in fza_init_send()
400 FZA_STATUS_GET_STATE(readw_u(&fp->regs->status))); in fza_init_send()
406 fp->name, stat, in fza_init_send()
407 FZA_STATUS_GET_STATE(readw_u(&fp->regs->status))); in fza_init_send()
410 pr_debug("%s: INIT: %lums elapsed\n", fp->name, in fza_init_send()
414 *init = fp->mmio + readl_u(&ring->buffer); in fza_init_send()
418 static void fza_rx_init(struct fza_private *fp) in fza_rx_init() argument
424 writel_o(0, &fp->ring_hst_rx[i].rmc); in fza_rx_init()
425 writel_o((fp->rx_dma[i] + 0x1000) >> 9, in fza_rx_init()
426 &fp->ring_hst_rx[i].buffer1); in fza_rx_init()
427 writel_o(fp->rx_dma[i] >> 9 | FZA_RING_OWN_FZA, in fza_rx_init()
428 &fp->ring_hst_rx[i].buf0_own); in fza_rx_init()
446 struct fza_private *fp = netdev_priv(dev); in fza_do_xmit() local
451 if (((((fp->ring_rmc_txd_index - 1 + fp->ring_rmc_tx_size) - in fza_do_xmit()
452 fp->ring_rmc_tx_index) % fp->ring_rmc_tx_size) * in fza_do_xmit()
456 first = fp->ring_rmc_tx_index; in fza_do_xmit()
465 i = fp->ring_rmc_tx_index; in fza_do_xmit()
466 rmc_tx_ptr = &fp->buffer_tx[i]; in fza_do_xmit()
484 writel_o(rmc, &fp->ring_rmc_tx[i].rmc); in fza_do_xmit()
485 writel_o(own, &fp->ring_rmc_tx[i].own); in fza_do_xmit()
488 fp->ring_rmc_tx_index = (fp->ring_rmc_tx_index + 1) % in fza_do_xmit()
489 fp->ring_rmc_tx_size; in fza_do_xmit()
496 if (((((fp->ring_rmc_txd_index - 1 + fp->ring_rmc_tx_size) - in fza_do_xmit()
497 fp->ring_rmc_tx_index) % fp->ring_rmc_tx_size) * in fza_do_xmit()
500 pr_debug("%s: queue stopped\n", fp->name); in fza_do_xmit()
503 writel_o(FZA_RING_TX_OWN_RMC, &fp->ring_rmc_tx[first].own); in fza_do_xmit()
506 writew_o(FZA_CONTROL_A_TX_POLL, &fp->regs->control_a); in fza_do_xmit()
514 struct fza_private *fp = netdev_priv(dev); in fza_do_recv_smt() local
519 i = fp->ring_smt_rx_index; in fza_do_recv_smt()
520 own = readl_o(&fp->ring_smt_rx[i].own); in fza_do_recv_smt()
524 smt_rx_ptr = fp->mmio + readl_u(&fp->ring_smt_rx[i].buffer); in fza_do_recv_smt()
529 writel_o(rmc, &fp->ring_smt_rx[i].rmc); in fza_do_recv_smt()
530 writel_o(FZA_RING_OWN_FZA, &fp->ring_smt_rx[i].own); in fza_do_recv_smt()
532 fp->ring_smt_rx_index = in fza_do_recv_smt()
533 (fp->ring_smt_rx_index + 1) % fp->ring_smt_rx_size; in fza_do_recv_smt()
536 writew_o(FZA_CONTROL_A_SMT_RX_POLL, &fp->regs->control_a); in fza_do_recv_smt()
543 struct fza_private *fp = netdev_priv(dev); in fza_tx() local
548 i = fp->ring_rmc_txd_index; in fza_tx()
549 if (i == fp->ring_rmc_tx_index) in fza_tx()
551 own = readl_o(&fp->ring_rmc_tx[i].own); in fza_tx()
555 rmc = readl_u(&fp->ring_rmc_tx[i].rmc); in fza_tx()
563 fp->stats.tx_packets++; in fza_tx()
564 fp->stats.tx_bytes += pkt_len; in fza_tx()
566 fp->stats.tx_errors++; in fza_tx()
571 fp->stats.tx_aborted_errors++; in fza_tx()
574 fp->stats.tx_fifo_errors++; in fza_tx()
583 fp->ring_rmc_txd_index = (fp->ring_rmc_txd_index + 1) % in fza_tx()
584 fp->ring_rmc_tx_size; in fza_tx()
587 if (((((fp->ring_rmc_txd_index - 1 + fp->ring_rmc_tx_size) - in fza_tx()
588 fp->ring_rmc_tx_index) % fp->ring_rmc_tx_size) * in fza_tx()
590 if (fp->queue_active) { in fza_tx()
592 pr_debug("%s: queue woken\n", fp->name); in fza_tx()
597 static inline int fza_rx_err(struct fza_private *fp, in fza_rx_err() argument
605 fp->stats.rx_errors++; in fza_rx_err()
613 fp->stats.rx_length_errors++; in fza_rx_err()
621 writew_o(FZA_CONTROL_A_HALT, &fp->regs->control_a); in fza_rx_err()
622 readw_o(&fp->regs->control_a); /* Synchronize. */ in fza_rx_err()
630 fp->stats.rx_crc_errors++; in fza_rx_err()
633 fp->stats.rx_frame_errors++; in fza_rx_err()
639 writew_o(FZA_CONTROL_A_HALT, &fp->regs->control_a); in fza_rx_err()
640 readw_o(&fp->regs->control_a); /* Synchronize. */ in fza_rx_err()
643 fp->stats.rx_frame_errors++; in fza_rx_err()
667 fp->stats.rx_errors++; in fza_rx_err()
668 fp->stats.rx_length_errors++; in fza_rx_err()
677 struct fza_private *fp = netdev_priv(dev); in fza_rx() local
686 i = fp->ring_hst_rx_index; in fza_rx()
687 own = readl_o(&fp->ring_hst_rx[i].buf0_own); in fza_rx()
691 rmc = readl_u(&fp->ring_hst_rx[i].rmc); in fza_rx()
692 skb = fp->rx_skbuff[i]; in fza_rx()
693 dma = fp->rx_dma[i]; in fza_rx()
703 dma_sync_single_for_cpu(fp->bdev, in fza_rx()
710 if (fza_rx_err(fp, rmc, fc)) in fza_rx()
717 newdma = dma_map_single(fp->bdev, newskb->data, in fza_rx()
720 if (dma_mapping_error(fp->bdev, newdma)) { in fza_rx()
730 dma_unmap_single(fp->bdev, dma, FZA_RX_BUFFER_SIZE, in fza_rx()
744 &fp->regs->control_a); in fza_rx()
756 fp->stats.rx_packets++; in fza_rx()
757 fp->stats.rx_bytes += pkt_len; in fza_rx()
759 fp->stats.multicast++; in fza_rx()
761 fp->stats.rx_dropped++; in fza_rx()
766 fp->rx_skbuff[i] = skb; in fza_rx()
767 fp->rx_dma[i] = dma; in fza_rx()
769 fp->stats.rx_dropped++; in fza_rx()
771 fp->name); in fza_rx()
775 writel_o(0, &fp->ring_hst_rx[i].rmc); in fza_rx()
777 writel_o(buf, &fp->ring_hst_rx[i].buffer1); in fza_rx()
779 writel_o(buf, &fp->ring_hst_rx[i].buf0_own); in fza_rx()
780 fp->ring_hst_rx_index = in fza_rx()
781 (fp->ring_hst_rx_index + 1) % fp->ring_hst_rx_size; in fza_rx()
787 struct fza_private *fp = netdev_priv(dev); in fza_tx_smt() local
793 i = fp->ring_smt_tx_index; in fza_tx_smt()
794 own = readl_o(&fp->ring_smt_tx[i].own); in fza_tx_smt()
798 smt_tx_ptr = fp->mmio + readl_u(&fp->ring_smt_tx[i].buffer); in fza_tx_smt()
799 len = readl_u(&fp->ring_smt_tx[i].rmc) & FZA_RING_PBC_MASK; in fza_tx_smt()
837 writel_o(FZA_RING_OWN_FZA, &fp->ring_smt_tx[i].own); in fza_tx_smt()
838 fp->ring_smt_tx_index = in fza_tx_smt()
839 (fp->ring_smt_tx_index + 1) % fp->ring_smt_tx_size; in fza_tx_smt()
845 struct fza_private *fp = netdev_priv(dev); in fza_uns() local
850 i = fp->ring_uns_index; in fza_uns()
851 own = readl_o(&fp->ring_uns[i].own); in fza_uns()
855 if (readl_u(&fp->ring_uns[i].id) == FZA_RING_UNS_RX_OVER) { in fza_uns()
856 fp->stats.rx_errors++; in fza_uns()
857 fp->stats.rx_over_errors++; in fza_uns()
860 writel_o(FZA_RING_OWN_FZA, &fp->ring_uns[i].own); in fza_uns()
861 fp->ring_uns_index = in fza_uns()
862 (fp->ring_uns_index + 1) % FZA_RING_UNS_SIZE; in fza_uns()
868 struct fza_private *fp = netdev_priv(dev); in fza_tx_flush() local
873 i = fp->ring_smt_tx_index; in fza_tx_flush()
875 writel_o(FZA_RING_OWN_FZA, &fp->ring_smt_tx[i].own); in fza_tx_flush()
876 fp->ring_smt_tx_index = in fza_tx_flush()
877 (fp->ring_smt_tx_index + 1) % fp->ring_smt_tx_size; in fza_tx_flush()
879 } while (i != fp->ring_smt_tx_index); in fza_tx_flush()
882 i = fp->ring_rmc_tx_index; in fza_tx_flush()
884 own = readl_o(&fp->ring_rmc_tx[i].own); in fza_tx_flush()
886 u32 rmc = readl_u(&fp->ring_rmc_tx[i].rmc); in fza_tx_flush()
889 &fp->ring_rmc_tx[i].rmc); in fza_tx_flush()
891 fp->ring_rmc_tx_index = in fza_tx_flush()
892 (fp->ring_rmc_tx_index + 1) % fp->ring_rmc_tx_size; in fza_tx_flush()
894 } while (i != fp->ring_rmc_tx_index); in fza_tx_flush()
897 writew_o(FZA_CONTROL_A_FLUSH_DONE, &fp->regs->control_a); in fza_tx_flush()
903 struct fza_private *fp = netdev_priv(dev); in fza_interrupt() local
907 int_event = readw_o(&fp->regs->int_event) & fp->int_mask; in fza_interrupt()
912 writew_u(int_event, &fp->regs->int_event); in fza_interrupt()
918 fp->irq_count_cmd_done++; in fza_interrupt()
920 spin_lock(&fp->lock); in fza_interrupt()
921 fp->cmd_done_flag = 1; in fza_interrupt()
922 wake_up(&fp->cmd_done_wait); in fza_interrupt()
923 spin_unlock(&fp->lock); in fza_interrupt()
928 fp->irq_count_tx_done++; in fza_interrupt()
934 fp->irq_count_rx_poll++; in fza_interrupt()
940 fp->irq_count_smt_tx_poll++; in fza_interrupt()
946 fp->irq_count_flush_tx++; in fza_interrupt()
954 fp->irq_count_link_st_chg++; in fza_interrupt()
955 status = readw_u(&fp->regs->status); in fza_interrupt()
958 pr_info("%s: link available\n", fp->name); in fza_interrupt()
961 pr_info("%s: link unavailable\n", fp->name); in fza_interrupt()
967 fp->irq_count_uns_poll++; in fza_interrupt()
975 fp->irq_count_state_chg++; in fza_interrupt()
977 status = readw_u(&fp->regs->status); in fza_interrupt()
979 pr_debug("%s: state change: %x\n", fp->name, state); in fza_interrupt()
986 del_timer_sync(&fp->reset_timer); in fza_interrupt()
987 fp->ring_cmd_index = 0; in fza_interrupt()
988 fp->ring_uns_index = 0; in fza_interrupt()
989 fp->ring_rmc_tx_index = 0; in fza_interrupt()
990 fp->ring_rmc_txd_index = 0; in fza_interrupt()
991 fp->ring_hst_rx_index = 0; in fza_interrupt()
992 fp->ring_smt_tx_index = 0; in fza_interrupt()
993 fp->ring_smt_rx_index = 0; in fza_interrupt()
994 if (fp->state > state) { in fza_interrupt()
995 pr_info("%s: OK\n", fp->name); in fza_interrupt()
1001 if (fp->state > state) { in fza_interrupt()
1009 fp->state = state; in fza_interrupt()
1010 fza_rx_init(fp); in fza_interrupt()
1011 fp->queue_active = 1; in fza_interrupt()
1013 pr_debug("%s: queue woken\n", fp->name); in fza_interrupt()
1017 fp->queue_active = 0; in fza_interrupt()
1019 pr_debug("%s: queue stopped\n", fp->name); in fza_interrupt()
1020 del_timer_sync(&fp->reset_timer); in fza_interrupt()
1021 pr_warn("%s: halted, reason: %x\n", fp->name, in fza_interrupt()
1023 fza_regs_dump(fp); in fza_interrupt()
1024 pr_info("%s: resetting the board...\n", fp->name); in fza_interrupt()
1025 fza_do_reset(fp); in fza_interrupt()
1026 fp->timer_state = 0; in fza_interrupt()
1027 fp->reset_timer.expires = jiffies + 45 * HZ; in fza_interrupt()
1028 add_timer(&fp->reset_timer); in fza_interrupt()
1032 pr_warn("%s: undefined state: %x\n", fp->name, state); in fza_interrupt()
1036 spin_lock(&fp->lock); in fza_interrupt()
1037 fp->state_chg_flag = 1; in fza_interrupt()
1038 wake_up(&fp->state_chg_wait); in fza_interrupt()
1039 spin_unlock(&fp->lock); in fza_interrupt()
1047 struct fza_private *fp = from_timer(fp, t, reset_timer); in fza_reset_timer() local
1049 if (!fp->timer_state) { in fza_reset_timer()
1050 pr_err("%s: RESET timed out!\n", fp->name); in fza_reset_timer()
1051 pr_info("%s: trying harder...\n", fp->name); in fza_reset_timer()
1054 writew_o(FZA_RESET_INIT, &fp->regs->reset); in fza_reset_timer()
1055 readw_o(&fp->regs->reset); /* Synchronize. */ in fza_reset_timer()
1057 fp->timer_state = 1; in fza_reset_timer()
1058 fp->reset_timer.expires = jiffies + HZ; in fza_reset_timer()
1061 writew_u(FZA_RESET_CLR, &fp->regs->reset); in fza_reset_timer()
1064 writew_o(fp->int_mask, &fp->regs->int_mask); in fza_reset_timer()
1065 readw_o(&fp->regs->int_mask); /* Synchronize. */ in fza_reset_timer()
1067 fp->timer_state = 0; in fza_reset_timer()
1068 fp->reset_timer.expires = jiffies + 45 * HZ; in fza_reset_timer()
1070 add_timer(&fp->reset_timer); in fza_reset_timer()
1080 struct fza_private *fp = netdev_priv(dev); in fza_start_xmit() local
1122 old_mask = fp->int_mask; in fza_start_xmit()
1124 writew_u(new_mask, &fp->regs->int_mask); in fza_start_xmit()
1125 readw_o(&fp->regs->int_mask); /* Synchronize. */ in fza_start_xmit()
1126 fp->int_mask = new_mask; in fza_start_xmit()
1130 fp->int_mask = old_mask; in fza_start_xmit()
1131 writew_u(fp->int_mask, &fp->regs->int_mask); in fza_start_xmit()
1138 pr_debug("%s: queue stopped\n", fp->name); in fza_start_xmit()
1139 fp->stats.tx_dropped++; in fza_start_xmit()
1149 struct fza_private *fp = netdev_priv(dev); in fza_open() local
1163 dma = dma_map_single(fp->bdev, skb->data, in fza_open()
1166 if (dma_mapping_error(fp->bdev, dma)) { in fza_open()
1173 dma_unmap_single(fp->bdev, fp->rx_dma[i], in fza_open()
1176 dev_kfree_skb(fp->rx_skbuff[i]); in fza_open()
1177 fp->rx_dma[i] = 0; in fza_open()
1178 fp->rx_skbuff[i] = NULL; in fza_open()
1182 fp->rx_skbuff[i] = skb; in fza_open()
1183 fp->rx_dma[i] = dma; in fza_open()
1193 spin_lock_irqsave(&fp->lock, flags); in fza_open()
1194 fp->cmd_done_flag = 0; in fza_open()
1196 spin_unlock_irqrestore(&fp->lock, flags); in fza_open()
1200 t = wait_event_timeout(fp->cmd_done_wait, fp->cmd_done_flag, 3 * HZ); in fza_open()
1201 if (fp->cmd_done_flag == 0) { in fza_open()
1202 pr_err("%s: PARAM command timed out!, state %x\n", fp->name, in fza_open()
1203 FZA_STATUS_GET_STATE(readw_u(&fp->regs->status))); in fza_open()
1209 fp->name, stat, in fza_open()
1210 FZA_STATUS_GET_STATE(readw_u(&fp->regs->status))); in fza_open()
1213 pr_debug("%s: PARAM: %lums elapsed\n", fp->name, in fza_open()
1221 struct fza_private *fp = netdev_priv(dev); in fza_close() local
1228 pr_debug("%s: queue stopped\n", fp->name); in fza_close()
1230 del_timer_sync(&fp->reset_timer); in fza_close()
1231 spin_lock_irqsave(&fp->lock, flags); in fza_close()
1232 fp->state = FZA_STATE_UNINITIALIZED; in fza_close()
1233 fp->state_chg_flag = 0; in fza_close()
1235 writew_o(FZA_CONTROL_A_SHUT, &fp->regs->control_a); in fza_close()
1236 readw_o(&fp->regs->control_a); /* Synchronize. */ in fza_close()
1237 spin_unlock_irqrestore(&fp->lock, flags); in fza_close()
1240 t = wait_event_timeout(fp->state_chg_wait, fp->state_chg_flag, in fza_close()
1242 state = FZA_STATUS_GET_STATE(readw_o(&fp->regs->status)); in fza_close()
1243 if (fp->state_chg_flag == 0) { in fza_close()
1244 pr_err("%s: SHUT timed out!, state %x\n", fp->name, state); in fza_close()
1248 pr_err("%s: SHUT failed!, state %x\n", fp->name, state); in fza_close()
1251 pr_debug("%s: SHUT: %lums elapsed\n", fp->name, in fza_close()
1255 if (fp->rx_skbuff[i]) { in fza_close()
1256 dma_unmap_single(fp->bdev, fp->rx_dma[i], in fza_close()
1258 dev_kfree_skb(fp->rx_skbuff[i]); in fza_close()
1259 fp->rx_dma[i] = 0; in fza_close()
1260 fp->rx_skbuff[i] = NULL; in fza_close()
1268 struct fza_private *fp = netdev_priv(dev); in fza_get_stats() local
1270 return &fp->stats; in fza_get_stats()
1289 struct fza_private *fp; in fza_probe() local
1300 dev = alloc_fddidev(sizeof(*fp)); in fza_probe()
1305 fp = netdev_priv(dev); in fza_probe()
1308 fp->bdev = bdev; in fza_probe()
1309 fp->name = dev_name(bdev); in fza_probe()
1315 pr_err("%s: cannot reserve MMIO region\n", fp->name); in fza_probe()
1323 pr_err("%s: cannot map MMIO\n", fp->name); in fza_probe()
1338 fp->mmio = mmio; in fza_probe()
1342 fp->name, (long long)tdev->resource.start, dev->irq); in fza_probe()
1343 pr_debug("%s: mapped at: 0x%p\n", fp->name, mmio); in fza_probe()
1345 fp->regs = mmio + FZA_REG_BASE; in fza_probe()
1346 fp->ring_cmd = mmio + FZA_RING_CMD; in fza_probe()
1347 fp->ring_uns = mmio + FZA_RING_UNS; in fza_probe()
1349 init_waitqueue_head(&fp->state_chg_wait); in fza_probe()
1350 init_waitqueue_head(&fp->cmd_done_wait); in fza_probe()
1351 spin_lock_init(&fp->lock); in fza_probe()
1352 fp->int_mask = FZA_MASK_NORMAL; in fza_probe()
1354 timer_setup(&fp->reset_timer, fza_reset_timer, 0); in fza_probe()
1357 fza_regs_dump(fp); in fza_probe()
1358 fza_do_shutdown(fp); in fza_probe()
1360 ret = request_irq(dev->irq, fza_interrupt, IRQF_SHARED, fp->name, dev); in fza_probe()
1362 pr_err("%s: unable to get IRQ %d!\n", fp->name, dev->irq); in fza_probe()
1367 writew_o(FZA_CONTROL_B_DRIVER, &fp->regs->control_b); in fza_probe()
1372 fp->ring_rmc_tx_size = FZA_RING_TX_SIZE; in fza_probe()
1374 ret = fza_reset(fp); in fza_probe()
1395 fp->ring_rmc_tx = mmio + readl_u(&init->rmc_tx); in fza_probe()
1396 fp->ring_rmc_tx_size = readl_u(&init->rmc_tx_size); in fza_probe()
1397 fp->ring_hst_rx = mmio + readl_u(&init->hst_rx); in fza_probe()
1398 fp->ring_hst_rx_size = readl_u(&init->hst_rx_size); in fza_probe()
1399 fp->ring_smt_tx = mmio + readl_u(&init->smt_tx); in fza_probe()
1400 fp->ring_smt_tx_size = readl_u(&init->smt_tx_size); in fza_probe()
1401 fp->ring_smt_rx = mmio + readl_u(&init->smt_rx); in fza_probe()
1402 fp->ring_smt_rx_size = readl_u(&init->smt_rx_size); in fza_probe()
1404 fp->buffer_tx = mmio + FZA_TX_BUFFER_ADDR(readl_u(&init->rmc_tx)); in fza_probe()
1406 fp->t_max = readl_u(&init->def_t_max); in fza_probe()
1407 fp->t_req = readl_u(&init->def_t_req); in fza_probe()
1408 fp->tvx = readl_u(&init->def_tvx); in fza_probe()
1409 fp->lem_threshold = readl_u(&init->lem_threshold); in fza_probe()
1410 fza_reads(&init->def_station_id, &fp->station_id, in fza_probe()
1411 sizeof(fp->station_id)); in fza_probe()
1412 fp->rtoken_timeout = readl_u(&init->rtoken_timeout); in fza_probe()
1413 fp->ring_purger = readl_u(&init->ring_purger); in fza_probe()
1418 pr_debug("%s: INIT parameters:\n", fp->name); in fza_probe()
1465 fp->name, in fza_probe()
1473 "SMT ver. %u\n", fp->name, rom_rev, fw_rev, rmc_rev, smt_ver); in fza_probe()
1489 pr_info("%s: registered as %s\n", fp->name, dev->name); in fza_probe()
1490 fp->name = (const char *)dev->name; in fza_probe()
1496 del_timer_sync(&fp->reset_timer); in fza_probe()
1497 fza_do_shutdown(fp); in fza_probe()
1507 pr_err("%s: initialization failure, aborting!\n", fp->name); in fza_probe()
1515 struct fza_private *fp = netdev_priv(dev); in fza_remove() local
1523 del_timer_sync(&fp->reset_timer); in fza_remove()
1524 fza_do_shutdown(fp); in fza_remove()
1527 iounmap(fp->mmio); in fza_remove()