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)";
97 // Define module-wide (static) routines
156 // Define module-wide (static) variables
182 * pdev - pointer to PCI device information
189 * 0 - This device (fddi0, fddi1, etc) configured successfully
190 * -ENODEV - No devices present, or no SysKonnect FDDI PCI device
225 err = -EIO; in skfp_init_one()
233 err = -EIO; in skfp_init_one()
242 err = -EIO; in skfp_init_one()
250 err = -ENOMEM; in skfp_init_one()
254 dev->irq = pdev->irq; in skfp_init_one()
255 dev->netdev_ops = &skfp_netdev_ops; in skfp_init_one()
257 SET_NETDEV_DEV(dev, &pdev->dev); in skfp_init_one()
259 /* Initialize board structure with bus-specific info */ in skfp_init_one()
261 smc->os.dev = dev; in skfp_init_one()
262 smc->os.bus_type = SK_BUS_TYPE_PCI; in skfp_init_one()
263 smc->os.pdev = *pdev; in skfp_init_one()
264 smc->os.QueueSkb = MAX_TX_QUEUE_LEN; in skfp_init_one()
265 smc->os.MaxFrameSize = MAX_FRAME_SIZE; in skfp_init_one()
266 smc->os.dev = dev; in skfp_init_one()
267 smc->hw.slot = -1; in skfp_init_one()
268 smc->hw.iop = mem; in skfp_init_one()
269 smc->os.ResetRequested = FALSE; in skfp_init_one()
270 skb_queue_head_init(&smc->os.SendSkbQueue); in skfp_init_one()
272 dev->base_addr = (unsigned long)mem; in skfp_init_one()
285 if ((pdev->subsystem_device & 0xff00) == 0x5500 || in skfp_init_one()
286 (pdev->subsystem_device & 0xff00) == 0x5800) in skfp_init_one()
288 " found (SK-%04X)\n", dev->name, in skfp_init_one()
289 pdev->subsystem_device); in skfp_init_one()
291 printk("%s: FDDI PCI adapter found\n", dev->name); in skfp_init_one()
295 if (smc->os.SharedMemAddr) in skfp_init_one()
296 dma_free_coherent(&pdev->dev, smc->os.SharedMemSize, in skfp_init_one()
297 smc->os.SharedMemAddr, in skfp_init_one()
298 smc->os.SharedMemDMA); in skfp_init_one()
299 dma_free_coherent(&pdev->dev, MAX_FRAME_SIZE, in skfp_init_one()
300 smc->os.LocalRxBuffer, smc->os.LocalRxBufferDMA); in skfp_init_one()
326 if (lp->os.SharedMemAddr) { in skfp_remove_one()
327 dma_free_coherent(&pdev->dev, in skfp_remove_one()
328 lp->os.SharedMemSize, in skfp_remove_one()
329 lp->os.SharedMemAddr, in skfp_remove_one()
330 lp->os.SharedMemDMA); in skfp_remove_one()
331 lp->os.SharedMemAddr = NULL; in skfp_remove_one()
333 if (lp->os.LocalRxBuffer) { in skfp_remove_one()
334 dma_free_coherent(&pdev->dev, in skfp_remove_one()
336 lp->os.LocalRxBuffer, in skfp_remove_one()
337 lp->os.LocalRxBufferDMA); in skfp_remove_one()
338 lp->os.LocalRxBuffer = NULL; in skfp_remove_one()
341 iounmap(lp->hw.iop); in skfp_remove_one()
343 ioport_unmap(lp->hw.iop); in skfp_remove_one()
364 * dev - pointer to device information
369 * The adapter is also reset. The OS must call skfp_open() to open
370 * the adapter and bring it on-line.
373 * 0 - initialization succeeded
374 * -1 - initialization failed
379 skfddi_priv *bp = &smc->os; in skfp_driver_init()
380 int err = -EIO; in skfp_driver_init()
385 bp->base_addr = dev->base_addr; in skfp_driver_init()
388 smc->hw.irq = dev->irq; in skfp_driver_init()
390 spin_lock_init(&bp->DriverLock); in skfp_driver_init()
393 bp->LocalRxBuffer = dma_alloc_coherent(&bp->pdev.dev, MAX_FRAME_SIZE, in skfp_driver_init()
394 &bp->LocalRxBufferDMA, in skfp_driver_init()
396 if (!bp->LocalRxBuffer) { in skfp_driver_init()
403 bp->SharedMemSize = mac_drv_check_space(); in skfp_driver_init()
404 pr_debug("Memory for HWM: %ld\n", bp->SharedMemSize); in skfp_driver_init()
405 if (bp->SharedMemSize > 0) { in skfp_driver_init()
406 bp->SharedMemSize += 16; // for descriptor alignment in skfp_driver_init()
408 bp->SharedMemAddr = dma_alloc_coherent(&bp->pdev.dev, in skfp_driver_init()
409 bp->SharedMemSize, in skfp_driver_init()
410 &bp->SharedMemDMA, in skfp_driver_init()
412 if (!bp->SharedMemAddr) { in skfp_driver_init()
415 bp->SharedMemSize); in skfp_driver_init()
420 bp->SharedMemAddr = NULL; in skfp_driver_init()
423 bp->SharedMemHeap = 0; in skfp_driver_init()
433 pr_debug("HW-Addr: %pMF\n", smc->hw.fddi_canon_addr.a); in skfp_driver_init()
434 memcpy(dev->dev_addr, smc->hw.fddi_canon_addr.a, ETH_ALEN); in skfp_driver_init()
441 if (bp->SharedMemAddr) { in skfp_driver_init()
442 dma_free_coherent(&bp->pdev.dev, in skfp_driver_init()
443 bp->SharedMemSize, in skfp_driver_init()
444 bp->SharedMemAddr, in skfp_driver_init()
445 bp->SharedMemDMA); in skfp_driver_init()
446 bp->SharedMemAddr = NULL; in skfp_driver_init()
448 if (bp->LocalRxBuffer) { in skfp_driver_init()
449 dma_free_coherent(&bp->pdev.dev, MAX_FRAME_SIZE, in skfp_driver_init()
450 bp->LocalRxBuffer, bp->LocalRxBufferDMA); in skfp_driver_init()
451 bp->LocalRxBuffer = NULL; in skfp_driver_init()
469 * dev - pointer to device information
475 * 0 - Adapter was successfully opened
476 * -EAGAIN - Could not register IRQ
484 /* Register IRQ - support shared interrupts by passing device ptr */ in skfp_open()
485 err = request_irq(dev->irq, skfp_interrupt, IRQF_SHARED, in skfp_open()
486 dev->name, dev); in skfp_open()
501 memcpy(dev->dev_addr, smc->hw.fddi_canon_addr.a, ETH_ALEN); in skfp_open()
530 * dev - pointer to device information
534 * The interrupt service routine is deregistered with the OS.
548 skfddi_priv *bp = &smc->os; in skfp_close()
558 free_irq(dev->irq, dev); in skfp_close()
560 skb_queue_purge(&bp->SendSkbQueue); in skfp_close()
561 bp->QueueSkb = MAX_TX_QUEUE_LEN; in skfp_close()
579 * irq - interrupt vector
580 * dev_id - pointer to device information
593 * on Intel-based systems) is done by the operating system outside this
609 bp = &smc->os; in skfp_interrupt()
617 if ((inpd(ISR_A) & smc->hw.is_imask) == 0) { // IRQ? in skfp_interrupt()
622 spin_lock(&bp->DriverLock); in skfp_interrupt()
627 if (smc->os.ResetRequested) { in skfp_interrupt()
629 smc->os.ResetRequested = FALSE; in skfp_interrupt()
631 spin_unlock(&bp->DriverLock); in skfp_interrupt()
650 * dev - pointer to device information
659 * have an FDDI-specific get statistics handler,
673 /* Fill the bp->stats structure with driver-maintained counters */ in skfp_ctl_get_stats()
675 bp->os.MacStat.port_bs_flag[0] = 0x1234; in skfp_ctl_get_stats()
676 bp->os.MacStat.port_bs_flag[1] = 0x5678; in skfp_ctl_get_stats()
681 /* Fill the bp->stats structure with the SMT MIB object values */ in skfp_ctl_get_stats()
683 …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()
684 bp->stats.smt_op_version_id = bp->cmd_rsp_virt->smt_mib_get.smt_op_version_id; in skfp_ctl_get_stats()
685 bp->stats.smt_hi_version_id = bp->cmd_rsp_virt->smt_mib_get.smt_hi_version_id; in skfp_ctl_get_stats()
686 bp->stats.smt_lo_version_id = bp->cmd_rsp_virt->smt_mib_get.smt_lo_version_id; in skfp_ctl_get_stats()
687 …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()
688 bp->stats.smt_mib_version_id = bp->cmd_rsp_virt->smt_mib_get.smt_mib_version_id; in skfp_ctl_get_stats()
689 bp->stats.smt_mac_cts = bp->cmd_rsp_virt->smt_mib_get.smt_mac_ct; in skfp_ctl_get_stats()
690 bp->stats.smt_non_master_cts = bp->cmd_rsp_virt->smt_mib_get.smt_non_master_ct; in skfp_ctl_get_stats()
691 bp->stats.smt_master_cts = bp->cmd_rsp_virt->smt_mib_get.smt_master_ct; in skfp_ctl_get_stats()
692 bp->stats.smt_available_paths = bp->cmd_rsp_virt->smt_mib_get.smt_available_paths; in skfp_ctl_get_stats()
693 bp->stats.smt_config_capabilities = bp->cmd_rsp_virt->smt_mib_get.smt_config_capabilities; in skfp_ctl_get_stats()
694 bp->stats.smt_config_policy = bp->cmd_rsp_virt->smt_mib_get.smt_config_policy; in skfp_ctl_get_stats()
695 bp->stats.smt_connection_policy = bp->cmd_rsp_virt->smt_mib_get.smt_connection_policy; in skfp_ctl_get_stats()
696 bp->stats.smt_t_notify = bp->cmd_rsp_virt->smt_mib_get.smt_t_notify; in skfp_ctl_get_stats()
697 bp->stats.smt_stat_rpt_policy = bp->cmd_rsp_virt->smt_mib_get.smt_stat_rpt_policy; in skfp_ctl_get_stats()
698 bp->stats.smt_trace_max_expiration = bp->cmd_rsp_virt->smt_mib_get.smt_trace_max_expiration; in skfp_ctl_get_stats()
699 bp->stats.smt_bypass_present = bp->cmd_rsp_virt->smt_mib_get.smt_bypass_present; in skfp_ctl_get_stats()
700 bp->stats.smt_ecm_state = bp->cmd_rsp_virt->smt_mib_get.smt_ecm_state; in skfp_ctl_get_stats()
701 bp->stats.smt_cf_state = bp->cmd_rsp_virt->smt_mib_get.smt_cf_state; in skfp_ctl_get_stats()
702 bp->stats.smt_remote_disconnect_flag = bp->cmd_rsp_virt->smt_mib_get.smt_remote_disconnect_flag; in skfp_ctl_get_stats()
703 bp->stats.smt_station_status = bp->cmd_rsp_virt->smt_mib_get.smt_station_status; in skfp_ctl_get_stats()
704 bp->stats.smt_peer_wrap_flag = bp->cmd_rsp_virt->smt_mib_get.smt_peer_wrap_flag; in skfp_ctl_get_stats()
705 bp->stats.smt_time_stamp = bp->cmd_rsp_virt->smt_mib_get.smt_msg_time_stamp.ls; in skfp_ctl_get_stats()
706 bp->stats.smt_transition_time_stamp = bp->cmd_rsp_virt->smt_mib_get.smt_transition_time_stamp.ls; in skfp_ctl_get_stats()
707 bp->stats.mac_frame_status_functions = bp->cmd_rsp_virt->smt_mib_get.mac_frame_status_functions; in skfp_ctl_get_stats()
708 bp->stats.mac_t_max_capability = bp->cmd_rsp_virt->smt_mib_get.mac_t_max_capability; in skfp_ctl_get_stats()
709 bp->stats.mac_tvx_capability = bp->cmd_rsp_virt->smt_mib_get.mac_tvx_capability; in skfp_ctl_get_stats()
710 bp->stats.mac_available_paths = bp->cmd_rsp_virt->smt_mib_get.mac_available_paths; in skfp_ctl_get_stats()
711 bp->stats.mac_current_path = bp->cmd_rsp_virt->smt_mib_get.mac_current_path; in skfp_ctl_get_stats()
712 memcpy(bp->stats.mac_upstream_nbr, &bp->cmd_rsp_virt->smt_mib_get.mac_upstream_nbr, FDDI_K_ALEN); in skfp_ctl_get_stats()
713 …memcpy(bp->stats.mac_downstream_nbr, &bp->cmd_rsp_virt->smt_mib_get.mac_downstream_nbr, FDDI_K_ALE… in skfp_ctl_get_stats()
714 …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()
715 …memcpy(bp->stats.mac_old_downstream_nbr, &bp->cmd_rsp_virt->smt_mib_get.mac_old_downstream_nbr, FD… in skfp_ctl_get_stats()
716 bp->stats.mac_dup_address_test = bp->cmd_rsp_virt->smt_mib_get.mac_dup_address_test; in skfp_ctl_get_stats()
717 bp->stats.mac_requested_paths = bp->cmd_rsp_virt->smt_mib_get.mac_requested_paths; in skfp_ctl_get_stats()
718 bp->stats.mac_downstream_port_type = bp->cmd_rsp_virt->smt_mib_get.mac_downstream_port_type; in skfp_ctl_get_stats()
719 memcpy(bp->stats.mac_smt_address, &bp->cmd_rsp_virt->smt_mib_get.mac_smt_address, FDDI_K_ALEN); in skfp_ctl_get_stats()
720 bp->stats.mac_t_req = bp->cmd_rsp_virt->smt_mib_get.mac_t_req; in skfp_ctl_get_stats()
721 bp->stats.mac_t_neg = bp->cmd_rsp_virt->smt_mib_get.mac_t_neg; in skfp_ctl_get_stats()
722 bp->stats.mac_t_max = bp->cmd_rsp_virt->smt_mib_get.mac_t_max; in skfp_ctl_get_stats()
723 bp->stats.mac_tvx_value = bp->cmd_rsp_virt->smt_mib_get.mac_tvx_value; in skfp_ctl_get_stats()
724 bp->stats.mac_frame_error_threshold = bp->cmd_rsp_virt->smt_mib_get.mac_frame_error_threshold; in skfp_ctl_get_stats()
725 bp->stats.mac_frame_error_ratio = bp->cmd_rsp_virt->smt_mib_get.mac_frame_error_ratio; in skfp_ctl_get_stats()
726 bp->stats.mac_rmt_state = bp->cmd_rsp_virt->smt_mib_get.mac_rmt_state; in skfp_ctl_get_stats()
727 bp->stats.mac_da_flag = bp->cmd_rsp_virt->smt_mib_get.mac_da_flag; in skfp_ctl_get_stats()
728 bp->stats.mac_una_da_flag = bp->cmd_rsp_virt->smt_mib_get.mac_unda_flag; in skfp_ctl_get_stats()
729 bp->stats.mac_frame_error_flag = bp->cmd_rsp_virt->smt_mib_get.mac_frame_error_flag; in skfp_ctl_get_stats()
730 bp->stats.mac_ma_unitdata_available = bp->cmd_rsp_virt->smt_mib_get.mac_ma_unitdata_available; in skfp_ctl_get_stats()
731 bp->stats.mac_hardware_present = bp->cmd_rsp_virt->smt_mib_get.mac_hardware_present; in skfp_ctl_get_stats()
732 bp->stats.mac_ma_unitdata_enable = bp->cmd_rsp_virt->smt_mib_get.mac_ma_unitdata_enable; in skfp_ctl_get_stats()
733 bp->stats.path_tvx_lower_bound = bp->cmd_rsp_virt->smt_mib_get.path_tvx_lower_bound; in skfp_ctl_get_stats()
734 bp->stats.path_t_max_lower_bound = bp->cmd_rsp_virt->smt_mib_get.path_t_max_lower_bound; in skfp_ctl_get_stats()
735 bp->stats.path_max_t_req = bp->cmd_rsp_virt->smt_mib_get.path_max_t_req; in skfp_ctl_get_stats()
736 …memcpy(bp->stats.path_configuration, &bp->cmd_rsp_virt->smt_mib_get.path_configuration, sizeof(bp-… in skfp_ctl_get_stats()
737 bp->stats.port_my_type[0] = bp->cmd_rsp_virt->smt_mib_get.port_my_type[0]; in skfp_ctl_get_stats()
738 bp->stats.port_my_type[1] = bp->cmd_rsp_virt->smt_mib_get.port_my_type[1]; in skfp_ctl_get_stats()
739 bp->stats.port_neighbor_type[0] = bp->cmd_rsp_virt->smt_mib_get.port_neighbor_type[0]; in skfp_ctl_get_stats()
740 bp->stats.port_neighbor_type[1] = bp->cmd_rsp_virt->smt_mib_get.port_neighbor_type[1]; in skfp_ctl_get_stats()
741 bp->stats.port_connection_policies[0] = bp->cmd_rsp_virt->smt_mib_get.port_connection_policies[0]; in skfp_ctl_get_stats()
742 bp->stats.port_connection_policies[1] = bp->cmd_rsp_virt->smt_mib_get.port_connection_policies[1]; in skfp_ctl_get_stats()
743 bp->stats.port_mac_indicated[0] = bp->cmd_rsp_virt->smt_mib_get.port_mac_indicated[0]; in skfp_ctl_get_stats()
744 bp->stats.port_mac_indicated[1] = bp->cmd_rsp_virt->smt_mib_get.port_mac_indicated[1]; in skfp_ctl_get_stats()
745 bp->stats.port_current_path[0] = bp->cmd_rsp_virt->smt_mib_get.port_current_path[0]; in skfp_ctl_get_stats()
746 bp->stats.port_current_path[1] = bp->cmd_rsp_virt->smt_mib_get.port_current_path[1]; in skfp_ctl_get_stats()
747 …memcpy(&bp->stats.port_requested_paths[0 * 3], &bp->cmd_rsp_virt->smt_mib_get.port_requested_paths… in skfp_ctl_get_stats()
748 …memcpy(&bp->stats.port_requested_paths[1 * 3], &bp->cmd_rsp_virt->smt_mib_get.port_requested_paths… in skfp_ctl_get_stats()
749 bp->stats.port_mac_placement[0] = bp->cmd_rsp_virt->smt_mib_get.port_mac_placement[0]; in skfp_ctl_get_stats()
750 bp->stats.port_mac_placement[1] = bp->cmd_rsp_virt->smt_mib_get.port_mac_placement[1]; in skfp_ctl_get_stats()
751 bp->stats.port_available_paths[0] = bp->cmd_rsp_virt->smt_mib_get.port_available_paths[0]; in skfp_ctl_get_stats()
752 bp->stats.port_available_paths[1] = bp->cmd_rsp_virt->smt_mib_get.port_available_paths[1]; in skfp_ctl_get_stats()
753 bp->stats.port_pmd_class[0] = bp->cmd_rsp_virt->smt_mib_get.port_pmd_class[0]; in skfp_ctl_get_stats()
754 bp->stats.port_pmd_class[1] = bp->cmd_rsp_virt->smt_mib_get.port_pmd_class[1]; in skfp_ctl_get_stats()
755 …bp->stats.port_connection_capabilities[0] = bp->cmd_rsp_virt->smt_mib_get.port_connection_capabili… in skfp_ctl_get_stats()
756 …bp->stats.port_connection_capabilities[1] = bp->cmd_rsp_virt->smt_mib_get.port_connection_capabili… in skfp_ctl_get_stats()
757 bp->stats.port_bs_flag[0] = bp->cmd_rsp_virt->smt_mib_get.port_bs_flag[0]; in skfp_ctl_get_stats()
758 bp->stats.port_bs_flag[1] = bp->cmd_rsp_virt->smt_mib_get.port_bs_flag[1]; in skfp_ctl_get_stats()
759 bp->stats.port_ler_estimate[0] = bp->cmd_rsp_virt->smt_mib_get.port_ler_estimate[0]; in skfp_ctl_get_stats()
760 bp->stats.port_ler_estimate[1] = bp->cmd_rsp_virt->smt_mib_get.port_ler_estimate[1]; in skfp_ctl_get_stats()
761 bp->stats.port_ler_cutoff[0] = bp->cmd_rsp_virt->smt_mib_get.port_ler_cutoff[0]; in skfp_ctl_get_stats()
762 bp->stats.port_ler_cutoff[1] = bp->cmd_rsp_virt->smt_mib_get.port_ler_cutoff[1]; in skfp_ctl_get_stats()
763 bp->stats.port_ler_alarm[0] = bp->cmd_rsp_virt->smt_mib_get.port_ler_alarm[0]; in skfp_ctl_get_stats()
764 bp->stats.port_ler_alarm[1] = bp->cmd_rsp_virt->smt_mib_get.port_ler_alarm[1]; in skfp_ctl_get_stats()
765 bp->stats.port_connect_state[0] = bp->cmd_rsp_virt->smt_mib_get.port_connect_state[0]; in skfp_ctl_get_stats()
766 bp->stats.port_connect_state[1] = bp->cmd_rsp_virt->smt_mib_get.port_connect_state[1]; in skfp_ctl_get_stats()
767 bp->stats.port_pcm_state[0] = bp->cmd_rsp_virt->smt_mib_get.port_pcm_state[0]; in skfp_ctl_get_stats()
768 bp->stats.port_pcm_state[1] = bp->cmd_rsp_virt->smt_mib_get.port_pcm_state[1]; in skfp_ctl_get_stats()
769 bp->stats.port_pc_withhold[0] = bp->cmd_rsp_virt->smt_mib_get.port_pc_withhold[0]; in skfp_ctl_get_stats()
770 bp->stats.port_pc_withhold[1] = bp->cmd_rsp_virt->smt_mib_get.port_pc_withhold[1]; in skfp_ctl_get_stats()
771 bp->stats.port_ler_flag[0] = bp->cmd_rsp_virt->smt_mib_get.port_ler_flag[0]; in skfp_ctl_get_stats()
772 bp->stats.port_ler_flag[1] = bp->cmd_rsp_virt->smt_mib_get.port_ler_flag[1]; in skfp_ctl_get_stats()
773 bp->stats.port_hardware_present[0] = bp->cmd_rsp_virt->smt_mib_get.port_hardware_present[0]; in skfp_ctl_get_stats()
774 bp->stats.port_hardware_present[1] = bp->cmd_rsp_virt->smt_mib_get.port_hardware_present[1]; in skfp_ctl_get_stats()
777 /* Fill the bp->stats structure with the FDDI counter values */ in skfp_ctl_get_stats()
779 bp->stats.mac_frame_cts = bp->cmd_rsp_virt->cntrs_get.cntrs.frame_cnt.ls; in skfp_ctl_get_stats()
780 bp->stats.mac_copied_cts = bp->cmd_rsp_virt->cntrs_get.cntrs.copied_cnt.ls; in skfp_ctl_get_stats()
781 bp->stats.mac_transmit_cts = bp->cmd_rsp_virt->cntrs_get.cntrs.transmit_cnt.ls; in skfp_ctl_get_stats()
782 bp->stats.mac_error_cts = bp->cmd_rsp_virt->cntrs_get.cntrs.error_cnt.ls; in skfp_ctl_get_stats()
783 bp->stats.mac_lost_cts = bp->cmd_rsp_virt->cntrs_get.cntrs.lost_cnt.ls; in skfp_ctl_get_stats()
784 bp->stats.port_lct_fail_cts[0] = bp->cmd_rsp_virt->cntrs_get.cntrs.lct_rejects[0].ls; in skfp_ctl_get_stats()
785 bp->stats.port_lct_fail_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.lct_rejects[1].ls; in skfp_ctl_get_stats()
786 bp->stats.port_lem_reject_cts[0] = bp->cmd_rsp_virt->cntrs_get.cntrs.lem_rejects[0].ls; in skfp_ctl_get_stats()
787 bp->stats.port_lem_reject_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.lem_rejects[1].ls; in skfp_ctl_get_stats()
788 bp->stats.port_lem_cts[0] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[0].ls; in skfp_ctl_get_stats()
789 bp->stats.port_lem_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[1].ls; in skfp_ctl_get_stats()
792 return (struct net_device_stats *)&bp->os.MacStat; in skfp_ctl_get_stats()
809 * dev - pointer to device information
831 * On-board adapter filters are updated.
836 skfddi_priv *bp = &smc->os; in skfp_ctl_set_multicast_list()
839 spin_lock_irqsave(&bp->DriverLock, Flags); in skfp_ctl_set_multicast_list()
841 spin_unlock_irqrestore(&bp->DriverLock, Flags); in skfp_ctl_set_multicast_list()
852 if (dev->flags & IFF_PROMISC) { in skfp_ctl_set_multicast_list_wo_lock()
865 if (dev->flags & IFF_ALLMULTI) { in skfp_ctl_set_multicast_list_wo_lock()
875 (struct fddi_addr *)ha->addr, in skfp_ctl_set_multicast_list_wo_lock()
879 ha->addr); in skfp_ctl_set_multicast_list_wo_lock()
910 * dev - pointer to device information
911 * addr - pointer to sockaddr structure containing unicast address to set
914 * The address pointed to by addr->sa_data is a valid unicast
921 skfddi_priv *bp = &smc->os; in skfp_ctl_set_mac_address()
925 memcpy(dev->dev_addr, p_sockaddr->sa_data, FDDI_K_ALEN); in skfp_ctl_set_mac_address()
926 spin_lock_irqsave(&bp->DriverLock, Flags); in skfp_ctl_set_mac_address()
928 spin_unlock_irqrestore(&bp->DriverLock, Flags); in skfp_ctl_set_mac_address()
946 * 0 - success
947 * other - failure
950 * dev - pointer to device information
951 * rq - pointer to ioctl request structure
952 * cmd - ?
960 skfddi_priv *lp = &smc->os; in skfp_ioctl()
964 if (copy_from_user(&ioc, rq->ifr_data, sizeof(struct s_skfp_ioctl))) in skfp_ioctl()
965 return -EFAULT; in skfp_ioctl()
969 ioc.len = sizeof(lp->MacStat); in skfp_ioctl()
971 ? -EFAULT : 0; in skfp_ioctl()
975 status = -EPERM; in skfp_ioctl()
977 memset(&lp->MacStat, 0, sizeof(lp->MacStat)); in skfp_ioctl()
981 printk("ioctl for %s: unknown cmd: %04x\n", dev->name, ioc.cmd); in skfp_ioctl()
982 status = -EOPNOTSUPP; in skfp_ioctl()
1002 * skb - pointer to sk_buff to queue for transmission
1003 * dev - pointer to device information
1009 * (skb->data) can be converted to a physical address
1021 * 0 - driver has queued and/or sent packet
1022 * 1 - caller should requeue the sk_buff for later transmission
1027 * 32-bit physical address can be determined.
1030 * same board and that the OS is not in another section of
1041 skfddi_priv *bp = &smc->os; in skfp_send_pkt()
1054 if (!(skb->len >= FDDI_K_LLC_ZLEN && skb->len <= FDDI_K_LLC_LEN)) { in skfp_send_pkt()
1055 bp->MacStat.gen.tx_errors++; /* bump error counter */ in skfp_send_pkt()
1061 if (bp->QueueSkb == 0) { // return with tbusy set: queue full in skfp_send_pkt()
1066 bp->QueueSkb--; in skfp_send_pkt()
1067 skb_queue_tail(&bp->SendSkbQueue, skb); in skfp_send_pkt()
1069 if (bp->QueueSkb == 0) { in skfp_send_pkt()
1090 * smc - pointer to smc (adapter) structure
1102 skfddi_priv *bp = &smc->os; in send_queued_packets()
1115 skb = skb_dequeue(&bp->SendSkbQueue); in send_queued_packets()
1122 spin_lock_irqsave(&bp->DriverLock, Flags); in send_queued_packets()
1123 fc = skb->data[0]; in send_queued_packets()
1130 if (!smc->ess.sync_bw_available) in send_queued_packets()
1135 if (smc->mib.fddiESSSynchTxMode) { in send_queued_packets()
1142 frame_status = hwm_tx_init(smc, fc, 1, skb->len, queue); in send_queued_packets()
1151 pr_debug("%s: out of TXDs.\n", bp->dev->name); in send_queued_packets()
1154 bp->dev->name); in send_queued_packets()
1159 skb_queue_head(&bp->SendSkbQueue, skb); in send_queued_packets()
1160 spin_unlock_irqrestore(&bp->DriverLock, Flags); in send_queued_packets()
1165 bp->QueueSkb++; // one packet less in local queue in send_queued_packets()
1168 CheckSourceAddress(skb->data, smc->hw.fddi_canon_addr.a); in send_queued_packets()
1172 dma_address = pci_map_single(&bp->pdev, skb->data, in send_queued_packets()
1173 skb->len, PCI_DMA_TODEVICE); in send_queued_packets()
1175 txd->txd_os.skb = skb; // save skb in send_queued_packets()
1176 txd->txd_os.dma_addr = dma_address; // save dma mapping in send_queued_packets()
1178 hwm_tx_frag(smc, skb->data, dma_address, skb->len, in send_queued_packets()
1182 pci_unmap_single(&bp->pdev, dma_address, in send_queued_packets()
1183 skb->len, PCI_DMA_TODEVICE); in send_queued_packets()
1186 spin_unlock_irqrestore(&bp->DriverLock, Flags); in send_queued_packets()
1222 * smc - A pointer to the SMT context struct.
1244 init_smt(smc, (smc->os.dev)->dev_addr); // Initialize the hardware. in ResetAdapter()
1250 skfp_ctl_set_multicast_list_wo_lock(smc->os.dev); in ResetAdapter()
1254 //--------------- functions called by hardware module ----------------
1267 * smc - A pointer to the SMT context struct.
1274 skfddi_priv *bp = &smc->os; in llc_restart_tx()
1279 spin_unlock(&bp->DriverLock); in llc_restart_tx()
1281 spin_lock(&bp->DriverLock); in llc_restart_tx()
1282 netif_start_queue(bp->dev);// system may send again if it was blocked in llc_restart_tx()
1294 * smc - A pointer to the SMT context struct.
1296 * size - Size of memory in bytes to allocate.
1307 virt = (void *) (smc->os.SharedMemAddr + smc->os.SharedMemHeap); in mac_drv_get_space()
1309 if ((smc->os.SharedMemHeap + size) > smc->os.SharedMemSize) { in mac_drv_get_space()
1313 smc->os.SharedMemHeap += size; // Move heap pointer. in mac_drv_get_space()
1318 (smc->os.SharedMemDMA + in mac_drv_get_space()
1319 ((char *) virt - (char *)smc->os.SharedMemAddr))); in mac_drv_get_space()
1331 * This memory must be non-cached, non-movable and non-swappable.
1334 * smc - A pointer to the SMT context struct.
1336 * size - Size of memory in bytes to allocate.
1349 // Descriptor memory must be aligned on 16-byte boundary. in mac_drv_get_desc_mem()
1353 size = (u_int) (16 - (((unsigned long) virt) & 15UL)); in mac_drv_get_desc_mem()
1373 * smc - A pointer to the SMT context struct.
1375 * virt - A (virtual) pointer into our 'shared' memory area.
1382 return smc->os.SharedMemDMA + in mac_drv_virt2phys()
1383 ((char *) virt - (char *)smc->os.SharedMemAddr); in mac_drv_virt2phys()
1392 * transfer. If the OS-specific module must prepare the system hardware
1399 * smc - A pointer to the SMT context struct.
1401 * virt - The virtual address of the data.
1403 * len - The length in bytes of the data.
1405 * flag - Indicates the transmit direction and the buffer type:
1417 return smc->os.SharedMemDMA + in dma_master()
1418 ((char *) virt - (char *)smc->os.SharedMemAddr); in dma_master()
1431 * smc - A pointer to the SMT context struct.
1433 * descr - A pointer to a TxD or RxD, respectively.
1435 * flag - Indicates the DMA transfer direction / SMT buffer:
1458 skfddi_priv *bp = &smc->os; in dma_complete()
1459 volatile struct s_smt_fp_rxd *r = &descr->r; in dma_complete()
1462 if (r->rxd_os.skb && r->rxd_os.dma_addr) { in dma_complete()
1463 int MaxFrameSize = bp->MaxFrameSize; in dma_complete()
1465 pci_unmap_single(&bp->pdev, r->rxd_os.dma_addr, in dma_complete()
1467 r->rxd_os.dma_addr = 0; in dma_complete()
1480 * smc - A pointer to the SMT context struct.
1482 * txd - A pointer to the last TxD which is used by the frame.
1494 if (!(skb = txd->txd_os.skb)) { in mac_drv_tx_complete()
1498 txd->txd_os.skb = NULL; in mac_drv_tx_complete()
1501 pci_unmap_single(&smc->os.pdev, txd->txd_os.dma_addr, in mac_drv_tx_complete()
1502 skb->len, PCI_DMA_TODEVICE); in mac_drv_tx_complete()
1503 txd->txd_os.dma_addr = 0; in mac_drv_tx_complete()
1505 smc->os.MacStat.gen.tx_packets++; // Count transmitted packets. in mac_drv_tx_complete()
1506 smc->os.MacStat.gen.tx_bytes+=skb->len; // Count bytes in mac_drv_tx_complete()
1523 printk(KERN_INFO "---Packet start---\n"); in dump_data()
1525 printk(KERN_INFO "------------------\n"); in dump_data()
1544 * smc - A pointer to the SMT context struct.
1546 * rxd - A pointer to the first RxD which is used by the receive frame.
1548 * frag_count - Count of RxDs used by the received frame.
1550 * len - Frame length.
1558 skfddi_priv *bp = &smc->os; in mac_drv_rx_complete()
1567 printk("fddi: Multi-fragment receive!\n"); in mac_drv_rx_complete()
1568 goto RequeueRxd; // Re-use the given RXD(s). in mac_drv_rx_complete()
1571 skb = rxd->rxd_os.skb; in mac_drv_rx_complete()
1574 smc->os.MacStat.gen.rx_errors++; in mac_drv_rx_complete()
1577 virt = skb->data; in mac_drv_rx_complete()
1581 dump_data(skb->data, len); in mac_drv_rx_complete()
1585 * +-------+-------+-------+------------+--------+------------+ in mac_drv_rx_complete()
1587 * +-------+-------+-------+------------+--------+------------+ in mac_drv_rx_complete()
1618 for (n = FDDI_MAC_HDR_LEN; n; n--) in mac_drv_rx_complete()
1619 *--virt = *--cp; in mac_drv_rx_complete()
1620 // adjust sbd->data pointer in mac_drv_rx_complete()
1622 len -= RifLength; in mac_drv_rx_complete()
1627 smc->os.MacStat.gen.rx_packets++; // Count indicated receive in mac_drv_rx_complete()
1629 smc->os.MacStat.gen.rx_bytes+=len; // Count bytes. in mac_drv_rx_complete()
1634 smc->os.MacStat.gen.multicast++; in mac_drv_rx_complete()
1638 rxd->rxd_os.skb = NULL; in mac_drv_rx_complete()
1640 skb->protocol = fddi_type_trans(skb, bp->dev); in mac_drv_rx_complete()
1648 pr_debug("Rx: re-queue RXD.\n"); in mac_drv_rx_complete()
1650 smc->os.MacStat.gen.rx_errors++; // Count receive packets in mac_drv_rx_complete()
1660 * The hardware module calls this function to request the OS-specific
1665 * smc - A pointer to the SMT context struct.
1667 * rxd - A pointer to the first RxD which is used by the receive frame.
1669 * frag_count - Count of RxDs used by the received frame.
1686 printk("fddi: Multi-fragment requeue!\n"); in mac_drv_requeue_rxd()
1688 MaxFrameSize = smc->os.MaxFrameSize; in mac_drv_requeue_rxd()
1690 for (; frag_count > 0; frag_count--) { in mac_drv_requeue_rxd()
1691 next_rxd = src_rxd->rxd_next; in mac_drv_requeue_rxd()
1694 skb = src_rxd->rxd_os.skb; in mac_drv_requeue_rxd()
1701 rxd->rxd_os.skb = skb; in mac_drv_requeue_rxd()
1704 v_addr = skb->data; in mac_drv_requeue_rxd()
1705 b_addr = pci_map_single(&smc->os.pdev, in mac_drv_requeue_rxd()
1709 rxd->rxd_os.dma_addr = b_addr; in mac_drv_requeue_rxd()
1713 rxd->rxd_os.skb = NULL; in mac_drv_requeue_rxd()
1714 v_addr = smc->os.LocalRxBuffer; in mac_drv_requeue_rxd()
1715 b_addr = smc->os.LocalRxBufferDMA; in mac_drv_requeue_rxd()
1719 rxd->rxd_os.skb = skb; in mac_drv_requeue_rxd()
1720 v_addr = skb->data; in mac_drv_requeue_rxd()
1721 b_addr = pci_map_single(&smc->os.pdev, in mac_drv_requeue_rxd()
1725 rxd->rxd_os.dma_addr = b_addr; in mac_drv_requeue_rxd()
1746 * smc - A pointer to the SMT context struct.
1764 MaxFrameSize = smc->os.MaxFrameSize; in mac_drv_fill_rxd()
1775 v_addr = skb->data; in mac_drv_fill_rxd()
1776 b_addr = pci_map_single(&smc->os.pdev, in mac_drv_fill_rxd()
1780 rxd->rxd_os.dma_addr = b_addr; in mac_drv_fill_rxd()
1788 v_addr = smc->os.LocalRxBuffer; in mac_drv_fill_rxd()
1789 b_addr = smc->os.LocalRxBufferDMA; in mac_drv_fill_rxd()
1792 rxd->rxd_os.skb = skb; in mac_drv_fill_rxd()
1809 * smc - A pointer to the SMT context struct.
1811 * rxd - A pointer to the first RxD which is used by the receive buffer.
1813 * frag_count - Count of RxDs used by the receive buffer.
1828 printk("fddi: Multi-fragment clear!\n"); in mac_drv_clear_rxd()
1830 for (; frag_count > 0; frag_count--) { in mac_drv_clear_rxd()
1831 skb = rxd->rxd_os.skb; in mac_drv_clear_rxd()
1833 skfddi_priv *bp = &smc->os; in mac_drv_clear_rxd()
1834 int MaxFrameSize = bp->MaxFrameSize; in mac_drv_clear_rxd()
1836 pci_unmap_single(&bp->pdev, rxd->rxd_os.dma_addr, in mac_drv_clear_rxd()
1840 rxd->rxd_os.skb = NULL; in mac_drv_clear_rxd()
1842 rxd = rxd->rxd_next; // Next RXD. in mac_drv_clear_rxd()
1861 * smc - A pointer to the SMT context struct.
1863 * len - The length (in bytes) of the received frame (FC, DA, SA, Data).
1865 * fc - The Frame Control field of the received frame.
1867 * look_ahead - A pointer to the lookahead data buffer (may be NULL).
1869 * la_len - The length of the lookahead data stored in the lookahead
1900 skb->protocol = fddi_type_trans(skb, smc->os.dev); in mac_drv_rx_init()
1917 * smc - A pointer to the SMT context struct.
1933 * smc - A pointer to the SMT context struct.
1935 * status - The current ring status.
2006 * smc - A pointer to the SMT context struct.
2008 * stat - = 0: A ring operational change occurred.
2025 smc->os.MacStat.gen.rx_errors++; in smt_stat_counter()
2040 * smc - A pointer to the SMT context struct.
2042 * c_state - Possible values are:
2098 * smc - A pointer to the SMT context struct.
2100 * e_state - Possible values are:
2153 * smc - A pointer to the SMT context struct.
2155 * r_state - Possible values are:
2173 s = "RM1_NON_OP - not operational"; in rmt_state_change()
2176 s = "RM2_RING_OP - ring operational"; in rmt_state_change()
2179 s = "RM3_DETECT - detect dupl addresses"; in rmt_state_change()
2182 s = "RM4_NON_OP_DUP - dupl. addr detected"; in rmt_state_change()
2185 s = "RM5_RING_OP_DUP - ring oper. with dupl. addr"; in rmt_state_change()
2188 s = "RM6_DIRECTED - sending directed beacons"; in rmt_state_change()
2191 s = "RM7_TRACE - trace initiated"; in rmt_state_change()
2210 * smc - A pointer to the SMT context struct.
2219 smc->os.ResetRequested = TRUE; // Set flag. in drv_reset_indication()