Lines Matching +full:os +full:- +full:initiated
1 // SPDX-License-Identifier: GPL-2.0-or-later
41 * 02-Mar-98 CG Created.
43 * 10-Mar-99 CG Support for 2.2.x added.
44 * 25-Mar-99 CG Corrected IRQ routing for SMP (APIC)
45 * 26-Oct-99 CG Fixed compilation error on 2.2.13
46 * 12-Nov-99 CG Source code release
47 * 22-Nov-99 CG Included in kernel source.
48 * 07-May-00 DM 64 bit fixes, new dma interface
49 * 31-Jul-03 DB Audit copy_*_user in skfp_ioctl
51 * 03-Dec-03 SH Convert to PCI device model
53 * Compilation options (-Dxxx):
58 * - i386
59 * - sparc64
62 /* Version information string - should be updated prior to */
68 " SK-55xx/SK-58xx adapters (SK-NET FDDI-FP/UP/LP)";
98 // Define module-wide (static) routines
158 // Define module-wide (static) variables
184 * pdev - pointer to PCI device information
191 * 0 - This device (fddi0, fddi1, etc) configured successfully
192 * -ENODEV - No devices present, or no SysKonnect FDDI PCI device
227 err = -EIO; in skfp_init_one()
235 err = -EIO; in skfp_init_one()
244 err = -EIO; in skfp_init_one()
252 err = -ENOMEM; in skfp_init_one()
256 dev->irq = pdev->irq; in skfp_init_one()
257 dev->netdev_ops = &skfp_netdev_ops; in skfp_init_one()
259 SET_NETDEV_DEV(dev, &pdev->dev); in skfp_init_one()
261 /* Initialize board structure with bus-specific info */ in skfp_init_one()
263 smc->os.dev = dev; in skfp_init_one()
264 smc->os.bus_type = SK_BUS_TYPE_PCI; in skfp_init_one()
265 smc->os.pdev = *pdev; in skfp_init_one()
266 smc->os.QueueSkb = MAX_TX_QUEUE_LEN; in skfp_init_one()
267 smc->os.MaxFrameSize = MAX_FRAME_SIZE; in skfp_init_one()
268 smc->os.dev = dev; in skfp_init_one()
269 smc->hw.slot = -1; in skfp_init_one()
270 smc->hw.iop = mem; in skfp_init_one()
271 smc->os.ResetRequested = FALSE; in skfp_init_one()
272 skb_queue_head_init(&smc->os.SendSkbQueue); in skfp_init_one()
274 dev->base_addr = (unsigned long)mem; in skfp_init_one()
287 if ((pdev->subsystem_device & 0xff00) == 0x5500 || in skfp_init_one()
288 (pdev->subsystem_device & 0xff00) == 0x5800) in skfp_init_one()
290 " found (SK-%04X)\n", dev->name, in skfp_init_one()
291 pdev->subsystem_device); in skfp_init_one()
293 printk("%s: FDDI PCI adapter found\n", dev->name); in skfp_init_one()
297 if (smc->os.SharedMemAddr) in skfp_init_one()
298 dma_free_coherent(&pdev->dev, smc->os.SharedMemSize, in skfp_init_one()
299 smc->os.SharedMemAddr, in skfp_init_one()
300 smc->os.SharedMemDMA); in skfp_init_one()
301 dma_free_coherent(&pdev->dev, MAX_FRAME_SIZE, in skfp_init_one()
302 smc->os.LocalRxBuffer, smc->os.LocalRxBufferDMA); in skfp_init_one()
328 if (lp->os.SharedMemAddr) { in skfp_remove_one()
329 dma_free_coherent(&pdev->dev, in skfp_remove_one()
330 lp->os.SharedMemSize, in skfp_remove_one()
331 lp->os.SharedMemAddr, in skfp_remove_one()
332 lp->os.SharedMemDMA); in skfp_remove_one()
333 lp->os.SharedMemAddr = NULL; in skfp_remove_one()
335 if (lp->os.LocalRxBuffer) { in skfp_remove_one()
336 dma_free_coherent(&pdev->dev, in skfp_remove_one()
338 lp->os.LocalRxBuffer, in skfp_remove_one()
339 lp->os.LocalRxBufferDMA); in skfp_remove_one()
340 lp->os.LocalRxBuffer = NULL; in skfp_remove_one()
343 iounmap(lp->hw.iop); in skfp_remove_one()
345 ioport_unmap(lp->hw.iop); in skfp_remove_one()
366 * dev - pointer to device information
371 * The adapter is also reset. The OS must call skfp_open() to open
372 * the adapter and bring it on-line.
375 * 0 - initialization succeeded
376 * -1 - initialization failed
381 skfddi_priv *bp = &smc->os; in skfp_driver_init()
382 int err = -EIO; in skfp_driver_init()
387 bp->base_addr = dev->base_addr; in skfp_driver_init()
390 smc->hw.irq = dev->irq; in skfp_driver_init()
392 spin_lock_init(&bp->DriverLock); in skfp_driver_init()
395 bp->LocalRxBuffer = dma_alloc_coherent(&bp->pdev.dev, MAX_FRAME_SIZE, in skfp_driver_init()
396 &bp->LocalRxBufferDMA, in skfp_driver_init()
398 if (!bp->LocalRxBuffer) { in skfp_driver_init()
405 bp->SharedMemSize = mac_drv_check_space(); in skfp_driver_init()
406 pr_debug("Memory for HWM: %ld\n", bp->SharedMemSize); in skfp_driver_init()
407 if (bp->SharedMemSize > 0) { in skfp_driver_init()
408 bp->SharedMemSize += 16; // for descriptor alignment in skfp_driver_init()
410 bp->SharedMemAddr = dma_alloc_coherent(&bp->pdev.dev, in skfp_driver_init()
411 bp->SharedMemSize, in skfp_driver_init()
412 &bp->SharedMemDMA, in skfp_driver_init()
414 if (!bp->SharedMemAddr) { in skfp_driver_init()
417 bp->SharedMemSize); in skfp_driver_init()
422 bp->SharedMemAddr = NULL; in skfp_driver_init()
425 bp->SharedMemHeap = 0; in skfp_driver_init()
435 pr_debug("HW-Addr: %pMF\n", smc->hw.fddi_canon_addr.a); in skfp_driver_init()
436 memcpy(dev->dev_addr, smc->hw.fddi_canon_addr.a, ETH_ALEN); in skfp_driver_init()
443 if (bp->SharedMemAddr) { in skfp_driver_init()
444 dma_free_coherent(&bp->pdev.dev, in skfp_driver_init()
445 bp->SharedMemSize, in skfp_driver_init()
446 bp->SharedMemAddr, in skfp_driver_init()
447 bp->SharedMemDMA); in skfp_driver_init()
448 bp->SharedMemAddr = NULL; in skfp_driver_init()
450 if (bp->LocalRxBuffer) { in skfp_driver_init()
451 dma_free_coherent(&bp->pdev.dev, MAX_FRAME_SIZE, in skfp_driver_init()
452 bp->LocalRxBuffer, bp->LocalRxBufferDMA); in skfp_driver_init()
453 bp->LocalRxBuffer = NULL; in skfp_driver_init()
471 * dev - pointer to device information
477 * 0 - Adapter was successfully opened
478 * -EAGAIN - Could not register IRQ
486 /* Register IRQ - support shared interrupts by passing device ptr */ in skfp_open()
487 err = request_irq(dev->irq, skfp_interrupt, IRQF_SHARED, in skfp_open()
488 dev->name, dev); in skfp_open()
503 memcpy(dev->dev_addr, smc->hw.fddi_canon_addr.a, ETH_ALEN); in skfp_open()
532 * dev - pointer to device information
536 * The interrupt service routine is deregistered with the OS.
550 skfddi_priv *bp = &smc->os; in skfp_close()
560 free_irq(dev->irq, dev); in skfp_close()
562 skb_queue_purge(&bp->SendSkbQueue); in skfp_close()
563 bp->QueueSkb = MAX_TX_QUEUE_LEN; in skfp_close()
581 * irq - interrupt vector
582 * dev_id - pointer to device information
595 * on Intel-based systems) is done by the operating system outside this
611 bp = &smc->os; in skfp_interrupt()
619 if ((inpd(ISR_A) & smc->hw.is_imask) == 0) { // IRQ? in skfp_interrupt()
624 spin_lock(&bp->DriverLock); in skfp_interrupt()
629 if (smc->os.ResetRequested) { in skfp_interrupt()
631 smc->os.ResetRequested = FALSE; in skfp_interrupt()
633 spin_unlock(&bp->DriverLock); in skfp_interrupt()
652 * dev - pointer to device information
661 * have an FDDI-specific get statistics handler,
675 /* Fill the bp->stats structure with driver-maintained counters */ in skfp_ctl_get_stats()
677 bp->os.MacStat.port_bs_flag[0] = 0x1234; in skfp_ctl_get_stats()
678 bp->os.MacStat.port_bs_flag[1] = 0x5678; in skfp_ctl_get_stats()
683 /* Fill the bp->stats structure with the SMT MIB object values */ in skfp_ctl_get_stats()
685 …memcpy(bp->stats.smt_station_id, &bp->cmd_rsp_virt->smt_mib_get.smt_station_id, sizeof(bp->cmd_rsp… in skfp_ctl_get_stats()
686 bp->stats.smt_op_version_id = bp->cmd_rsp_virt->smt_mib_get.smt_op_version_id; in skfp_ctl_get_stats()
687 bp->stats.smt_hi_version_id = bp->cmd_rsp_virt->smt_mib_get.smt_hi_version_id; in skfp_ctl_get_stats()
688 bp->stats.smt_lo_version_id = bp->cmd_rsp_virt->smt_mib_get.smt_lo_version_id; in skfp_ctl_get_stats()
689 …memcpy(bp->stats.smt_user_data, &bp->cmd_rsp_virt->smt_mib_get.smt_user_data, sizeof(bp->cmd_rsp_v… in skfp_ctl_get_stats()
690 bp->stats.smt_mib_version_id = bp->cmd_rsp_virt->smt_mib_get.smt_mib_version_id; in skfp_ctl_get_stats()
691 bp->stats.smt_mac_cts = bp->cmd_rsp_virt->smt_mib_get.smt_mac_ct; in skfp_ctl_get_stats()
692 bp->stats.smt_non_master_cts = bp->cmd_rsp_virt->smt_mib_get.smt_non_master_ct; in skfp_ctl_get_stats()
693 bp->stats.smt_master_cts = bp->cmd_rsp_virt->smt_mib_get.smt_master_ct; in skfp_ctl_get_stats()
694 bp->stats.smt_available_paths = bp->cmd_rsp_virt->smt_mib_get.smt_available_paths; in skfp_ctl_get_stats()
695 bp->stats.smt_config_capabilities = bp->cmd_rsp_virt->smt_mib_get.smt_config_capabilities; in skfp_ctl_get_stats()
696 bp->stats.smt_config_policy = bp->cmd_rsp_virt->smt_mib_get.smt_config_policy; in skfp_ctl_get_stats()
697 bp->stats.smt_connection_policy = bp->cmd_rsp_virt->smt_mib_get.smt_connection_policy; in skfp_ctl_get_stats()
698 bp->stats.smt_t_notify = bp->cmd_rsp_virt->smt_mib_get.smt_t_notify; in skfp_ctl_get_stats()
699 bp->stats.smt_stat_rpt_policy = bp->cmd_rsp_virt->smt_mib_get.smt_stat_rpt_policy; in skfp_ctl_get_stats()
700 bp->stats.smt_trace_max_expiration = bp->cmd_rsp_virt->smt_mib_get.smt_trace_max_expiration; in skfp_ctl_get_stats()
701 bp->stats.smt_bypass_present = bp->cmd_rsp_virt->smt_mib_get.smt_bypass_present; in skfp_ctl_get_stats()
702 bp->stats.smt_ecm_state = bp->cmd_rsp_virt->smt_mib_get.smt_ecm_state; in skfp_ctl_get_stats()
703 bp->stats.smt_cf_state = bp->cmd_rsp_virt->smt_mib_get.smt_cf_state; in skfp_ctl_get_stats()
704 bp->stats.smt_remote_disconnect_flag = bp->cmd_rsp_virt->smt_mib_get.smt_remote_disconnect_flag; in skfp_ctl_get_stats()
705 bp->stats.smt_station_status = bp->cmd_rsp_virt->smt_mib_get.smt_station_status; in skfp_ctl_get_stats()
706 bp->stats.smt_peer_wrap_flag = bp->cmd_rsp_virt->smt_mib_get.smt_peer_wrap_flag; in skfp_ctl_get_stats()
707 bp->stats.smt_time_stamp = bp->cmd_rsp_virt->smt_mib_get.smt_msg_time_stamp.ls; in skfp_ctl_get_stats()
708 bp->stats.smt_transition_time_stamp = bp->cmd_rsp_virt->smt_mib_get.smt_transition_time_stamp.ls; in skfp_ctl_get_stats()
709 bp->stats.mac_frame_status_functions = bp->cmd_rsp_virt->smt_mib_get.mac_frame_status_functions; in skfp_ctl_get_stats()
710 bp->stats.mac_t_max_capability = bp->cmd_rsp_virt->smt_mib_get.mac_t_max_capability; in skfp_ctl_get_stats()
711 bp->stats.mac_tvx_capability = bp->cmd_rsp_virt->smt_mib_get.mac_tvx_capability; in skfp_ctl_get_stats()
712 bp->stats.mac_available_paths = bp->cmd_rsp_virt->smt_mib_get.mac_available_paths; in skfp_ctl_get_stats()
713 bp->stats.mac_current_path = bp->cmd_rsp_virt->smt_mib_get.mac_current_path; in skfp_ctl_get_stats()
714 memcpy(bp->stats.mac_upstream_nbr, &bp->cmd_rsp_virt->smt_mib_get.mac_upstream_nbr, FDDI_K_ALEN); in skfp_ctl_get_stats()
715 …memcpy(bp->stats.mac_downstream_nbr, &bp->cmd_rsp_virt->smt_mib_get.mac_downstream_nbr, FDDI_K_ALE… in skfp_ctl_get_stats()
716 …memcpy(bp->stats.mac_old_upstream_nbr, &bp->cmd_rsp_virt->smt_mib_get.mac_old_upstream_nbr, FDDI_K… in skfp_ctl_get_stats()
717 …memcpy(bp->stats.mac_old_downstream_nbr, &bp->cmd_rsp_virt->smt_mib_get.mac_old_downstream_nbr, FD… in skfp_ctl_get_stats()
718 bp->stats.mac_dup_address_test = bp->cmd_rsp_virt->smt_mib_get.mac_dup_address_test; in skfp_ctl_get_stats()
719 bp->stats.mac_requested_paths = bp->cmd_rsp_virt->smt_mib_get.mac_requested_paths; in skfp_ctl_get_stats()
720 bp->stats.mac_downstream_port_type = bp->cmd_rsp_virt->smt_mib_get.mac_downstream_port_type; in skfp_ctl_get_stats()
721 memcpy(bp->stats.mac_smt_address, &bp->cmd_rsp_virt->smt_mib_get.mac_smt_address, FDDI_K_ALEN); in skfp_ctl_get_stats()
722 bp->stats.mac_t_req = bp->cmd_rsp_virt->smt_mib_get.mac_t_req; in skfp_ctl_get_stats()
723 bp->stats.mac_t_neg = bp->cmd_rsp_virt->smt_mib_get.mac_t_neg; in skfp_ctl_get_stats()
724 bp->stats.mac_t_max = bp->cmd_rsp_virt->smt_mib_get.mac_t_max; in skfp_ctl_get_stats()
725 bp->stats.mac_tvx_value = bp->cmd_rsp_virt->smt_mib_get.mac_tvx_value; in skfp_ctl_get_stats()
726 bp->stats.mac_frame_error_threshold = bp->cmd_rsp_virt->smt_mib_get.mac_frame_error_threshold; in skfp_ctl_get_stats()
727 bp->stats.mac_frame_error_ratio = bp->cmd_rsp_virt->smt_mib_get.mac_frame_error_ratio; in skfp_ctl_get_stats()
728 bp->stats.mac_rmt_state = bp->cmd_rsp_virt->smt_mib_get.mac_rmt_state; in skfp_ctl_get_stats()
729 bp->stats.mac_da_flag = bp->cmd_rsp_virt->smt_mib_get.mac_da_flag; in skfp_ctl_get_stats()
730 bp->stats.mac_una_da_flag = bp->cmd_rsp_virt->smt_mib_get.mac_unda_flag; in skfp_ctl_get_stats()
731 bp->stats.mac_frame_error_flag = bp->cmd_rsp_virt->smt_mib_get.mac_frame_error_flag; in skfp_ctl_get_stats()
732 bp->stats.mac_ma_unitdata_available = bp->cmd_rsp_virt->smt_mib_get.mac_ma_unitdata_available; in skfp_ctl_get_stats()
733 bp->stats.mac_hardware_present = bp->cmd_rsp_virt->smt_mib_get.mac_hardware_present; in skfp_ctl_get_stats()
734 bp->stats.mac_ma_unitdata_enable = bp->cmd_rsp_virt->smt_mib_get.mac_ma_unitdata_enable; in skfp_ctl_get_stats()
735 bp->stats.path_tvx_lower_bound = bp->cmd_rsp_virt->smt_mib_get.path_tvx_lower_bound; in skfp_ctl_get_stats()
736 bp->stats.path_t_max_lower_bound = bp->cmd_rsp_virt->smt_mib_get.path_t_max_lower_bound; in skfp_ctl_get_stats()
737 bp->stats.path_max_t_req = bp->cmd_rsp_virt->smt_mib_get.path_max_t_req; in skfp_ctl_get_stats()
738 …memcpy(bp->stats.path_configuration, &bp->cmd_rsp_virt->smt_mib_get.path_configuration, sizeof(bp-… in skfp_ctl_get_stats()
739 bp->stats.port_my_type[0] = bp->cmd_rsp_virt->smt_mib_get.port_my_type[0]; in skfp_ctl_get_stats()
740 bp->stats.port_my_type[1] = bp->cmd_rsp_virt->smt_mib_get.port_my_type[1]; in skfp_ctl_get_stats()
741 bp->stats.port_neighbor_type[0] = bp->cmd_rsp_virt->smt_mib_get.port_neighbor_type[0]; in skfp_ctl_get_stats()
742 bp->stats.port_neighbor_type[1] = bp->cmd_rsp_virt->smt_mib_get.port_neighbor_type[1]; in skfp_ctl_get_stats()
743 bp->stats.port_connection_policies[0] = bp->cmd_rsp_virt->smt_mib_get.port_connection_policies[0]; in skfp_ctl_get_stats()
744 bp->stats.port_connection_policies[1] = bp->cmd_rsp_virt->smt_mib_get.port_connection_policies[1]; in skfp_ctl_get_stats()
745 bp->stats.port_mac_indicated[0] = bp->cmd_rsp_virt->smt_mib_get.port_mac_indicated[0]; in skfp_ctl_get_stats()
746 bp->stats.port_mac_indicated[1] = bp->cmd_rsp_virt->smt_mib_get.port_mac_indicated[1]; in skfp_ctl_get_stats()
747 bp->stats.port_current_path[0] = bp->cmd_rsp_virt->smt_mib_get.port_current_path[0]; in skfp_ctl_get_stats()
748 bp->stats.port_current_path[1] = bp->cmd_rsp_virt->smt_mib_get.port_current_path[1]; in skfp_ctl_get_stats()
749 …memcpy(&bp->stats.port_requested_paths[0 * 3], &bp->cmd_rsp_virt->smt_mib_get.port_requested_paths… in skfp_ctl_get_stats()
750 …memcpy(&bp->stats.port_requested_paths[1 * 3], &bp->cmd_rsp_virt->smt_mib_get.port_requested_paths… in skfp_ctl_get_stats()
751 bp->stats.port_mac_placement[0] = bp->cmd_rsp_virt->smt_mib_get.port_mac_placement[0]; in skfp_ctl_get_stats()
752 bp->stats.port_mac_placement[1] = bp->cmd_rsp_virt->smt_mib_get.port_mac_placement[1]; in skfp_ctl_get_stats()
753 bp->stats.port_available_paths[0] = bp->cmd_rsp_virt->smt_mib_get.port_available_paths[0]; in skfp_ctl_get_stats()
754 bp->stats.port_available_paths[1] = bp->cmd_rsp_virt->smt_mib_get.port_available_paths[1]; in skfp_ctl_get_stats()
755 bp->stats.port_pmd_class[0] = bp->cmd_rsp_virt->smt_mib_get.port_pmd_class[0]; in skfp_ctl_get_stats()
756 bp->stats.port_pmd_class[1] = bp->cmd_rsp_virt->smt_mib_get.port_pmd_class[1]; in skfp_ctl_get_stats()
757 …bp->stats.port_connection_capabilities[0] = bp->cmd_rsp_virt->smt_mib_get.port_connection_capabili… in skfp_ctl_get_stats()
758 …bp->stats.port_connection_capabilities[1] = bp->cmd_rsp_virt->smt_mib_get.port_connection_capabili… in skfp_ctl_get_stats()
759 bp->stats.port_bs_flag[0] = bp->cmd_rsp_virt->smt_mib_get.port_bs_flag[0]; in skfp_ctl_get_stats()
760 bp->stats.port_bs_flag[1] = bp->cmd_rsp_virt->smt_mib_get.port_bs_flag[1]; in skfp_ctl_get_stats()
761 bp->stats.port_ler_estimate[0] = bp->cmd_rsp_virt->smt_mib_get.port_ler_estimate[0]; in skfp_ctl_get_stats()
762 bp->stats.port_ler_estimate[1] = bp->cmd_rsp_virt->smt_mib_get.port_ler_estimate[1]; in skfp_ctl_get_stats()
763 bp->stats.port_ler_cutoff[0] = bp->cmd_rsp_virt->smt_mib_get.port_ler_cutoff[0]; in skfp_ctl_get_stats()
764 bp->stats.port_ler_cutoff[1] = bp->cmd_rsp_virt->smt_mib_get.port_ler_cutoff[1]; in skfp_ctl_get_stats()
765 bp->stats.port_ler_alarm[0] = bp->cmd_rsp_virt->smt_mib_get.port_ler_alarm[0]; in skfp_ctl_get_stats()
766 bp->stats.port_ler_alarm[1] = bp->cmd_rsp_virt->smt_mib_get.port_ler_alarm[1]; in skfp_ctl_get_stats()
767 bp->stats.port_connect_state[0] = bp->cmd_rsp_virt->smt_mib_get.port_connect_state[0]; in skfp_ctl_get_stats()
768 bp->stats.port_connect_state[1] = bp->cmd_rsp_virt->smt_mib_get.port_connect_state[1]; in skfp_ctl_get_stats()
769 bp->stats.port_pcm_state[0] = bp->cmd_rsp_virt->smt_mib_get.port_pcm_state[0]; in skfp_ctl_get_stats()
770 bp->stats.port_pcm_state[1] = bp->cmd_rsp_virt->smt_mib_get.port_pcm_state[1]; in skfp_ctl_get_stats()
771 bp->stats.port_pc_withhold[0] = bp->cmd_rsp_virt->smt_mib_get.port_pc_withhold[0]; in skfp_ctl_get_stats()
772 bp->stats.port_pc_withhold[1] = bp->cmd_rsp_virt->smt_mib_get.port_pc_withhold[1]; in skfp_ctl_get_stats()
773 bp->stats.port_ler_flag[0] = bp->cmd_rsp_virt->smt_mib_get.port_ler_flag[0]; in skfp_ctl_get_stats()
774 bp->stats.port_ler_flag[1] = bp->cmd_rsp_virt->smt_mib_get.port_ler_flag[1]; in skfp_ctl_get_stats()
775 bp->stats.port_hardware_present[0] = bp->cmd_rsp_virt->smt_mib_get.port_hardware_present[0]; in skfp_ctl_get_stats()
776 bp->stats.port_hardware_present[1] = bp->cmd_rsp_virt->smt_mib_get.port_hardware_present[1]; in skfp_ctl_get_stats()
779 /* Fill the bp->stats structure with the FDDI counter values */ in skfp_ctl_get_stats()
781 bp->stats.mac_frame_cts = bp->cmd_rsp_virt->cntrs_get.cntrs.frame_cnt.ls; in skfp_ctl_get_stats()
782 bp->stats.mac_copied_cts = bp->cmd_rsp_virt->cntrs_get.cntrs.copied_cnt.ls; in skfp_ctl_get_stats()
783 bp->stats.mac_transmit_cts = bp->cmd_rsp_virt->cntrs_get.cntrs.transmit_cnt.ls; in skfp_ctl_get_stats()
784 bp->stats.mac_error_cts = bp->cmd_rsp_virt->cntrs_get.cntrs.error_cnt.ls; in skfp_ctl_get_stats()
785 bp->stats.mac_lost_cts = bp->cmd_rsp_virt->cntrs_get.cntrs.lost_cnt.ls; in skfp_ctl_get_stats()
786 bp->stats.port_lct_fail_cts[0] = bp->cmd_rsp_virt->cntrs_get.cntrs.lct_rejects[0].ls; in skfp_ctl_get_stats()
787 bp->stats.port_lct_fail_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.lct_rejects[1].ls; in skfp_ctl_get_stats()
788 bp->stats.port_lem_reject_cts[0] = bp->cmd_rsp_virt->cntrs_get.cntrs.lem_rejects[0].ls; in skfp_ctl_get_stats()
789 bp->stats.port_lem_reject_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.lem_rejects[1].ls; in skfp_ctl_get_stats()
790 bp->stats.port_lem_cts[0] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[0].ls; in skfp_ctl_get_stats()
791 bp->stats.port_lem_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[1].ls; in skfp_ctl_get_stats()
794 return (struct net_device_stats *)&bp->os.MacStat; in skfp_ctl_get_stats()
811 * dev - pointer to device information
833 * On-board adapter filters are updated.
838 skfddi_priv *bp = &smc->os; in skfp_ctl_set_multicast_list()
841 spin_lock_irqsave(&bp->DriverLock, Flags); in skfp_ctl_set_multicast_list()
843 spin_unlock_irqrestore(&bp->DriverLock, Flags); in skfp_ctl_set_multicast_list()
854 if (dev->flags & IFF_PROMISC) { in skfp_ctl_set_multicast_list_wo_lock()
867 if (dev->flags & IFF_ALLMULTI) { in skfp_ctl_set_multicast_list_wo_lock()
877 (struct fddi_addr *)ha->addr, in skfp_ctl_set_multicast_list_wo_lock()
881 ha->addr); in skfp_ctl_set_multicast_list_wo_lock()
912 * dev - pointer to device information
913 * addr - pointer to sockaddr structure containing unicast address to set
916 * The address pointed to by addr->sa_data is a valid unicast
923 skfddi_priv *bp = &smc->os; in skfp_ctl_set_mac_address()
927 memcpy(dev->dev_addr, p_sockaddr->sa_data, FDDI_K_ALEN); in skfp_ctl_set_mac_address()
928 spin_lock_irqsave(&bp->DriverLock, Flags); in skfp_ctl_set_mac_address()
930 spin_unlock_irqrestore(&bp->DriverLock, Flags); in skfp_ctl_set_mac_address()
948 * 0 - success
949 * other - failure
952 * dev - pointer to device information
953 * rq - pointer to ioctl request structure
954 * cmd - ?
962 skfddi_priv *lp = &smc->os; in skfp_siocdevprivate()
967 return -EFAULT; in skfp_siocdevprivate()
970 return -EOPNOTSUPP; in skfp_siocdevprivate()
974 ioc.len = sizeof(lp->MacStat); in skfp_siocdevprivate()
976 ? -EFAULT : 0; in skfp_siocdevprivate()
980 status = -EPERM; in skfp_siocdevprivate()
982 memset(&lp->MacStat, 0, sizeof(lp->MacStat)); in skfp_siocdevprivate()
986 printk("ioctl for %s: unknown cmd: %04x\n", dev->name, ioc.cmd); in skfp_siocdevprivate()
987 status = -EOPNOTSUPP; in skfp_siocdevprivate()
1007 * skb - pointer to sk_buff to queue for transmission
1008 * dev - pointer to device information
1014 * (skb->data) can be converted to a physical address
1026 * 0 - driver has queued and/or sent packet
1027 * 1 - caller should requeue the sk_buff for later transmission
1032 * 32-bit physical address can be determined.
1035 * same board and that the OS is not in another section of
1046 skfddi_priv *bp = &smc->os; in skfp_send_pkt()
1059 if (!(skb->len >= FDDI_K_LLC_ZLEN && skb->len <= FDDI_K_LLC_LEN)) { in skfp_send_pkt()
1060 bp->MacStat.gen.tx_errors++; /* bump error counter */ in skfp_send_pkt()
1066 if (bp->QueueSkb == 0) { // return with tbusy set: queue full in skfp_send_pkt()
1071 bp->QueueSkb--; in skfp_send_pkt()
1072 skb_queue_tail(&bp->SendSkbQueue, skb); in skfp_send_pkt()
1074 if (bp->QueueSkb == 0) { in skfp_send_pkt()
1095 * smc - pointer to smc (adapter) structure
1107 skfddi_priv *bp = &smc->os; in send_queued_packets()
1120 skb = skb_dequeue(&bp->SendSkbQueue); in send_queued_packets()
1127 spin_lock_irqsave(&bp->DriverLock, Flags); in send_queued_packets()
1128 fc = skb->data[0]; in send_queued_packets()
1135 if (!smc->ess.sync_bw_available) in send_queued_packets()
1140 if (smc->mib.fddiESSSynchTxMode) { in send_queued_packets()
1147 frame_status = hwm_tx_init(smc, fc, 1, skb->len, queue); in send_queued_packets()
1156 pr_debug("%s: out of TXDs.\n", bp->dev->name); in send_queued_packets()
1159 bp->dev->name); in send_queued_packets()
1164 skb_queue_head(&bp->SendSkbQueue, skb); in send_queued_packets()
1165 spin_unlock_irqrestore(&bp->DriverLock, Flags); in send_queued_packets()
1170 bp->QueueSkb++; // one packet less in local queue in send_queued_packets()
1173 CheckSourceAddress(skb->data, smc->hw.fddi_canon_addr.a); in send_queued_packets()
1177 dma_address = dma_map_single(&(&bp->pdev)->dev, skb->data, in send_queued_packets()
1178 skb->len, DMA_TO_DEVICE); in send_queued_packets()
1180 txd->txd_os.skb = skb; // save skb in send_queued_packets()
1181 txd->txd_os.dma_addr = dma_address; // save dma mapping in send_queued_packets()
1183 hwm_tx_frag(smc, skb->data, dma_address, skb->len, in send_queued_packets()
1187 dma_unmap_single(&(&bp->pdev)->dev, dma_address, in send_queued_packets()
1188 skb->len, DMA_TO_DEVICE); in send_queued_packets()
1191 spin_unlock_irqrestore(&bp->DriverLock, Flags); in send_queued_packets()
1227 * smc - A pointer to the SMT context struct.
1249 init_smt(smc, (smc->os.dev)->dev_addr); // Initialize the hardware. in ResetAdapter()
1255 skfp_ctl_set_multicast_list_wo_lock(smc->os.dev); in ResetAdapter()
1259 //--------------- functions called by hardware module ----------------
1272 * smc - A pointer to the SMT context struct.
1279 skfddi_priv *bp = &smc->os; in llc_restart_tx()
1284 spin_unlock(&bp->DriverLock); in llc_restart_tx()
1286 spin_lock(&bp->DriverLock); in llc_restart_tx()
1287 netif_start_queue(bp->dev);// system may send again if it was blocked in llc_restart_tx()
1299 * smc - A pointer to the SMT context struct.
1301 * size - Size of memory in bytes to allocate.
1312 virt = (void *) (smc->os.SharedMemAddr + smc->os.SharedMemHeap); in mac_drv_get_space()
1314 if ((smc->os.SharedMemHeap + size) > smc->os.SharedMemSize) { in mac_drv_get_space()
1318 smc->os.SharedMemHeap += size; // Move heap pointer. in mac_drv_get_space()
1323 (smc->os.SharedMemDMA + in mac_drv_get_space()
1324 ((char *) virt - (char *)smc->os.SharedMemAddr))); in mac_drv_get_space()
1336 * This memory must be non-cached, non-movable and non-swappable.
1339 * smc - A pointer to the SMT context struct.
1341 * size - Size of memory in bytes to allocate.
1354 // Descriptor memory must be aligned on 16-byte boundary. in mac_drv_get_desc_mem()
1358 size = (u_int) (16 - (((unsigned long) virt) & 15UL)); in mac_drv_get_desc_mem()
1378 * smc - A pointer to the SMT context struct.
1380 * virt - A (virtual) pointer into our 'shared' memory area.
1387 return smc->os.SharedMemDMA + in mac_drv_virt2phys()
1388 ((char *) virt - (char *)smc->os.SharedMemAddr); in mac_drv_virt2phys()
1397 * transfer. If the OS-specific module must prepare the system hardware
1404 * smc - A pointer to the SMT context struct.
1406 * virt - The virtual address of the data.
1408 * len - The length in bytes of the data.
1410 * flag - Indicates the transmit direction and the buffer type:
1422 return smc->os.SharedMemDMA + in dma_master()
1423 ((char *) virt - (char *)smc->os.SharedMemAddr); in dma_master()
1436 * smc - A pointer to the SMT context struct.
1438 * descr - A pointer to a TxD or RxD, respectively.
1440 * flag - Indicates the DMA transfer direction / SMT buffer:
1463 skfddi_priv *bp = &smc->os; in dma_complete()
1464 volatile struct s_smt_fp_rxd *r = &descr->r; in dma_complete()
1467 if (r->rxd_os.skb && r->rxd_os.dma_addr) { in dma_complete()
1468 int MaxFrameSize = bp->MaxFrameSize; in dma_complete()
1470 dma_unmap_single(&(&bp->pdev)->dev, in dma_complete()
1471 r->rxd_os.dma_addr, MaxFrameSize, in dma_complete()
1473 r->rxd_os.dma_addr = 0; in dma_complete()
1486 * smc - A pointer to the SMT context struct.
1488 * txd - A pointer to the last TxD which is used by the frame.
1500 if (!(skb = txd->txd_os.skb)) { in mac_drv_tx_complete()
1504 txd->txd_os.skb = NULL; in mac_drv_tx_complete()
1507 dma_unmap_single(&(&smc->os.pdev)->dev, txd->txd_os.dma_addr, in mac_drv_tx_complete()
1508 skb->len, DMA_TO_DEVICE); in mac_drv_tx_complete()
1509 txd->txd_os.dma_addr = 0; in mac_drv_tx_complete()
1511 smc->os.MacStat.gen.tx_packets++; // Count transmitted packets. in mac_drv_tx_complete()
1512 smc->os.MacStat.gen.tx_bytes+=skb->len; // Count bytes in mac_drv_tx_complete()
1529 printk(KERN_INFO "---Packet start---\n"); in dump_data()
1531 printk(KERN_INFO "------------------\n"); in dump_data()
1550 * smc - A pointer to the SMT context struct.
1552 * rxd - A pointer to the first RxD which is used by the receive frame.
1554 * frag_count - Count of RxDs used by the received frame.
1556 * len - Frame length.
1564 skfddi_priv *bp = &smc->os; in mac_drv_rx_complete()
1573 printk("fddi: Multi-fragment receive!\n"); in mac_drv_rx_complete()
1574 goto RequeueRxd; // Re-use the given RXD(s). in mac_drv_rx_complete()
1577 skb = rxd->rxd_os.skb; in mac_drv_rx_complete()
1580 smc->os.MacStat.gen.rx_errors++; in mac_drv_rx_complete()
1583 virt = skb->data; in mac_drv_rx_complete()
1587 dump_data(skb->data, len); in mac_drv_rx_complete()
1591 * +-------+-------+-------+------------+--------+------------+ in mac_drv_rx_complete()
1593 * +-------+-------+-------+------------+--------+------------+ in mac_drv_rx_complete()
1624 for (n = FDDI_MAC_HDR_LEN; n; n--) in mac_drv_rx_complete()
1625 *--virt = *--cp; in mac_drv_rx_complete()
1626 // adjust sbd->data pointer in mac_drv_rx_complete()
1628 len -= RifLength; in mac_drv_rx_complete()
1633 smc->os.MacStat.gen.rx_packets++; // Count indicated receive in mac_drv_rx_complete()
1635 smc->os.MacStat.gen.rx_bytes+=len; // Count bytes. in mac_drv_rx_complete()
1640 smc->os.MacStat.gen.multicast++; in mac_drv_rx_complete()
1644 rxd->rxd_os.skb = NULL; in mac_drv_rx_complete()
1646 skb->protocol = fddi_type_trans(skb, bp->dev); in mac_drv_rx_complete()
1654 pr_debug("Rx: re-queue RXD.\n"); in mac_drv_rx_complete()
1656 smc->os.MacStat.gen.rx_errors++; // Count receive packets in mac_drv_rx_complete()
1666 * The hardware module calls this function to request the OS-specific
1671 * smc - A pointer to the SMT context struct.
1673 * rxd - A pointer to the first RxD which is used by the receive frame.
1675 * frag_count - Count of RxDs used by the received frame.
1692 printk("fddi: Multi-fragment requeue!\n"); in mac_drv_requeue_rxd()
1694 MaxFrameSize = smc->os.MaxFrameSize; in mac_drv_requeue_rxd()
1696 for (; frag_count > 0; frag_count--) { in mac_drv_requeue_rxd()
1697 next_rxd = src_rxd->rxd_next; in mac_drv_requeue_rxd()
1700 skb = src_rxd->rxd_os.skb; in mac_drv_requeue_rxd()
1707 rxd->rxd_os.skb = skb; in mac_drv_requeue_rxd()
1710 v_addr = skb->data; in mac_drv_requeue_rxd()
1711 b_addr = dma_map_single(&(&smc->os.pdev)->dev, in mac_drv_requeue_rxd()
1714 rxd->rxd_os.dma_addr = b_addr; in mac_drv_requeue_rxd()
1718 rxd->rxd_os.skb = NULL; in mac_drv_requeue_rxd()
1719 v_addr = smc->os.LocalRxBuffer; in mac_drv_requeue_rxd()
1720 b_addr = smc->os.LocalRxBufferDMA; in mac_drv_requeue_rxd()
1724 rxd->rxd_os.skb = skb; in mac_drv_requeue_rxd()
1725 v_addr = skb->data; in mac_drv_requeue_rxd()
1726 b_addr = dma_map_single(&(&smc->os.pdev)->dev, v_addr, in mac_drv_requeue_rxd()
1728 rxd->rxd_os.dma_addr = b_addr; in mac_drv_requeue_rxd()
1749 * smc - A pointer to the SMT context struct.
1767 MaxFrameSize = smc->os.MaxFrameSize; in mac_drv_fill_rxd()
1778 v_addr = skb->data; in mac_drv_fill_rxd()
1779 b_addr = dma_map_single(&(&smc->os.pdev)->dev, v_addr, in mac_drv_fill_rxd()
1781 rxd->rxd_os.dma_addr = b_addr; in mac_drv_fill_rxd()
1789 v_addr = smc->os.LocalRxBuffer; in mac_drv_fill_rxd()
1790 b_addr = smc->os.LocalRxBufferDMA; in mac_drv_fill_rxd()
1793 rxd->rxd_os.skb = skb; in mac_drv_fill_rxd()
1810 * smc - A pointer to the SMT context struct.
1812 * rxd - A pointer to the first RxD which is used by the receive buffer.
1814 * frag_count - Count of RxDs used by the receive buffer.
1829 printk("fddi: Multi-fragment clear!\n"); in mac_drv_clear_rxd()
1831 for (; frag_count > 0; frag_count--) { in mac_drv_clear_rxd()
1832 skb = rxd->rxd_os.skb; in mac_drv_clear_rxd()
1834 skfddi_priv *bp = &smc->os; in mac_drv_clear_rxd()
1835 int MaxFrameSize = bp->MaxFrameSize; in mac_drv_clear_rxd()
1837 dma_unmap_single(&(&bp->pdev)->dev, in mac_drv_clear_rxd()
1838 rxd->rxd_os.dma_addr, MaxFrameSize, in mac_drv_clear_rxd()
1842 rxd->rxd_os.skb = NULL; in mac_drv_clear_rxd()
1844 rxd = rxd->rxd_next; // Next RXD. in mac_drv_clear_rxd()
1863 * smc - A pointer to the SMT context struct.
1865 * len - The length (in bytes) of the received frame (FC, DA, SA, Data).
1867 * fc - The Frame Control field of the received frame.
1869 * look_ahead - A pointer to the lookahead data buffer (may be NULL).
1871 * la_len - The length of the lookahead data stored in the lookahead
1902 skb->protocol = fddi_type_trans(skb, smc->os.dev); in mac_drv_rx_init()
1919 * smc - A pointer to the SMT context struct.
1935 * smc - A pointer to the SMT context struct.
1937 * status - The current ring status.
2008 * smc - A pointer to the SMT context struct.
2010 * stat - = 0: A ring operational change occurred.
2027 smc->os.MacStat.gen.rx_errors++; in smt_stat_counter()
2042 * smc - A pointer to the SMT context struct.
2044 * c_state - Possible values are:
2100 * smc - A pointer to the SMT context struct.
2102 * e_state - Possible values are:
2155 * smc - A pointer to the SMT context struct.
2157 * r_state - Possible values are:
2175 s = "RM1_NON_OP - not operational"; in rmt_state_change()
2178 s = "RM2_RING_OP - ring operational"; in rmt_state_change()
2181 s = "RM3_DETECT - detect dupl addresses"; in rmt_state_change()
2184 s = "RM4_NON_OP_DUP - dupl. addr detected"; in rmt_state_change()
2187 s = "RM5_RING_OP_DUP - ring oper. with dupl. addr"; in rmt_state_change()
2190 s = "RM6_DIRECTED - sending directed beacons"; in rmt_state_change()
2193 s = "RM7_TRACE - trace initiated"; in rmt_state_change()
2212 * smc - A pointer to the SMT context struct.
2221 smc->os.ResetRequested = TRUE; // Set flag. in drv_reset_indication()