68 #define VERSION "2.07"
70 static const char *
const boot_msg =
71 "SysKonnect FDDI PCI Adapter driver v" VERSION " for\n"
72 " SK-55xx/SK-58xx adapters (SK-NET FDDI-FP/UP/LP)";
76 #include <linux/capability.h>
77 #include <linux/module.h>
78 #include <linux/kernel.h>
79 #include <linux/errno.h>
82 #include <linux/pci.h>
83 #include <linux/netdevice.h>
86 #include <linux/bitops.h>
89 #include <asm/byteorder.h>
91 #include <asm/uaccess.h>
94 #undef ADDR // undo Linux definition
107 static void skfp_ctl_set_multicast_list(
struct net_device *
dev);
108 static void skfp_ctl_set_multicast_list_wo_lock(
struct net_device *
dev);
113 static void send_queued_packets(
struct s_smc *
smc);
114 static void CheckSourceAddress(
unsigned char *
frame,
unsigned char *hw_addr);
115 static void ResetAdapter(
struct s_smc *
smc);
128 int frag_count,
int len);
162 static int num_boards;
165 .ndo_open = skfp_open,
166 .ndo_stop = skfp_close,
167 .ndo_start_xmit = skfp_send_pkt,
168 .ndo_get_stats = skfp_ctl_get_stats,
170 .ndo_set_rx_mode = skfp_ctl_set_multicast_list,
171 .ndo_set_mac_address = skfp_ctl_set_mac_address,
172 .ndo_do_ioctl = skfp_ioctl,
204 static int skfp_init_one(
struct pci_dev *pdev,
212 pr_debug(
"entering skfp_init_one\n");
246 "FDDI adapter will be disabled.\n");
254 "FDDI adapter will be disabled.\n");
265 smc = netdev_priv(dev);
268 smc->
os.pdev = *pdev;
274 smc->
os.ResetRequested =
FALSE;
275 skb_queue_head_init(&smc->
os.SendSkbQueue);
279 err = skfp_driver_init(dev);
288 pci_set_drvdata(pdev, dev);
292 printk(
"%s: SysKonnect FDDI PCI adapter"
293 " found (SK-%04X)\n", dev->
name,
296 printk(
"%s: FDDI PCI adapter found\n", dev->
name);
300 if (smc->
os.SharedMemAddr)
302 smc->
os.SharedMemAddr,
303 smc->
os.SharedMemDMA);
305 smc->
os.LocalRxBuffer, smc->
os.LocalRxBufferDMA);
327 struct s_smc *
lp = netdev_priv(p);
331 if (lp->
os.SharedMemAddr) {
333 lp->
os.SharedMemSize,
334 lp->
os.SharedMemAddr,
335 lp->
os.SharedMemDMA);
336 lp->
os.SharedMemAddr =
NULL;
338 if (lp->
os.LocalRxBuffer) {
341 lp->
os.LocalRxBuffer,
342 lp->
os.LocalRxBufferDMA);
343 lp->
os.LocalRxBuffer =
NULL;
354 pci_set_drvdata(pdev,
NULL);
382 static int skfp_driver_init(
struct net_device *dev)
384 struct s_smc *smc = netdev_priv(dev);
388 pr_debug(
"entering skfp_driver_init\n");
394 smc->
hw.irq = dev->
irq;
401 printk(
"could not allocate mem for ");
416 printk(
"could not allocate mem for ");
417 printk(
"hardware module: %ld byte\n",
434 pr_debug(
"mac_drv_init() failed\n");
438 pr_debug(
"HW-Addr: %pMF\n", smc->
hw.fddi_canon_addr.a);
485 struct s_smc *smc = netdev_priv(dev);
518 netif_start_queue(dev);
552 struct s_smc *smc = netdev_priv(dev);
561 netif_stop_queue(dev);
613 smc = netdev_priv(dev);
622 if ((
inpd(ISR_A) & smc->
hw.is_imask) == 0) {
632 if (smc->
os.ResetRequested) {
634 smc->
os.ResetRequested =
FALSE;
676 struct s_smc *bp = netdev_priv(dev);
680 bp->
os.MacStat.port_bs_flag[0] = 0x1234;
681 bp->
os.MacStat.port_bs_flag[1] = 0x5678;
688 memcpy(bp->stats.smt_station_id, &bp->cmd_rsp_virt->smt_mib_get.smt_station_id,
sizeof(bp->cmd_rsp_virt->smt_mib_get.smt_station_id));
689 bp->stats.smt_op_version_id = bp->cmd_rsp_virt->smt_mib_get.smt_op_version_id;
690 bp->stats.smt_hi_version_id = bp->cmd_rsp_virt->smt_mib_get.smt_hi_version_id;
691 bp->stats.smt_lo_version_id = bp->cmd_rsp_virt->smt_mib_get.smt_lo_version_id;
692 memcpy(bp->stats.smt_user_data, &bp->cmd_rsp_virt->smt_mib_get.smt_user_data,
sizeof(bp->cmd_rsp_virt->smt_mib_get.smt_user_data));
693 bp->stats.smt_mib_version_id = bp->cmd_rsp_virt->smt_mib_get.smt_mib_version_id;
694 bp->stats.smt_mac_cts = bp->cmd_rsp_virt->smt_mib_get.smt_mac_ct;
695 bp->stats.smt_non_master_cts = bp->cmd_rsp_virt->smt_mib_get.smt_non_master_ct;
696 bp->stats.smt_master_cts = bp->cmd_rsp_virt->smt_mib_get.smt_master_ct;
697 bp->stats.smt_available_paths = bp->cmd_rsp_virt->smt_mib_get.smt_available_paths;
698 bp->stats.smt_config_capabilities = bp->cmd_rsp_virt->smt_mib_get.smt_config_capabilities;
699 bp->stats.smt_config_policy = bp->cmd_rsp_virt->smt_mib_get.smt_config_policy;
700 bp->stats.smt_connection_policy = bp->cmd_rsp_virt->smt_mib_get.smt_connection_policy;
701 bp->stats.smt_t_notify = bp->cmd_rsp_virt->smt_mib_get.smt_t_notify;
702 bp->stats.smt_stat_rpt_policy = bp->cmd_rsp_virt->smt_mib_get.smt_stat_rpt_policy;
703 bp->stats.smt_trace_max_expiration = bp->cmd_rsp_virt->smt_mib_get.smt_trace_max_expiration;
704 bp->stats.smt_bypass_present = bp->cmd_rsp_virt->smt_mib_get.smt_bypass_present;
705 bp->stats.smt_ecm_state = bp->cmd_rsp_virt->smt_mib_get.smt_ecm_state;
706 bp->stats.smt_cf_state = bp->cmd_rsp_virt->smt_mib_get.smt_cf_state;
707 bp->stats.smt_remote_disconnect_flag = bp->cmd_rsp_virt->smt_mib_get.smt_remote_disconnect_flag;
708 bp->stats.smt_station_status = bp->cmd_rsp_virt->smt_mib_get.smt_station_status;
709 bp->stats.smt_peer_wrap_flag = bp->cmd_rsp_virt->smt_mib_get.smt_peer_wrap_flag;
710 bp->stats.smt_time_stamp = bp->cmd_rsp_virt->smt_mib_get.smt_msg_time_stamp.ls;
711 bp->stats.smt_transition_time_stamp = bp->cmd_rsp_virt->smt_mib_get.smt_transition_time_stamp.ls;
712 bp->stats.mac_frame_status_functions = bp->cmd_rsp_virt->smt_mib_get.mac_frame_status_functions;
713 bp->stats.mac_t_max_capability = bp->cmd_rsp_virt->smt_mib_get.mac_t_max_capability;
714 bp->stats.mac_tvx_capability = bp->cmd_rsp_virt->smt_mib_get.mac_tvx_capability;
715 bp->stats.mac_available_paths = bp->cmd_rsp_virt->smt_mib_get.mac_available_paths;
716 bp->stats.mac_current_path = bp->cmd_rsp_virt->smt_mib_get.mac_current_path;
717 memcpy(bp->stats.mac_upstream_nbr, &bp->cmd_rsp_virt->smt_mib_get.mac_upstream_nbr,
FDDI_K_ALEN);
718 memcpy(bp->stats.mac_downstream_nbr, &bp->cmd_rsp_virt->smt_mib_get.mac_downstream_nbr,
FDDI_K_ALEN);
719 memcpy(bp->stats.mac_old_upstream_nbr, &bp->cmd_rsp_virt->smt_mib_get.mac_old_upstream_nbr,
FDDI_K_ALEN);
720 memcpy(bp->stats.mac_old_downstream_nbr, &bp->cmd_rsp_virt->smt_mib_get.mac_old_downstream_nbr,
FDDI_K_ALEN);
721 bp->stats.mac_dup_address_test = bp->cmd_rsp_virt->smt_mib_get.mac_dup_address_test;
722 bp->stats.mac_requested_paths = bp->cmd_rsp_virt->smt_mib_get.mac_requested_paths;
723 bp->stats.mac_downstream_port_type = bp->cmd_rsp_virt->smt_mib_get.mac_downstream_port_type;
724 memcpy(bp->stats.mac_smt_address, &bp->cmd_rsp_virt->smt_mib_get.mac_smt_address,
FDDI_K_ALEN);
725 bp->stats.mac_t_req = bp->cmd_rsp_virt->smt_mib_get.mac_t_req;
726 bp->stats.mac_t_neg = bp->cmd_rsp_virt->smt_mib_get.mac_t_neg;
727 bp->stats.mac_t_max = bp->cmd_rsp_virt->smt_mib_get.mac_t_max;
728 bp->stats.mac_tvx_value = bp->cmd_rsp_virt->smt_mib_get.mac_tvx_value;
729 bp->stats.mac_frame_error_threshold = bp->cmd_rsp_virt->smt_mib_get.mac_frame_error_threshold;
730 bp->stats.mac_frame_error_ratio = bp->cmd_rsp_virt->smt_mib_get.mac_frame_error_ratio;
731 bp->stats.mac_rmt_state = bp->cmd_rsp_virt->smt_mib_get.mac_rmt_state;
732 bp->stats.mac_da_flag = bp->cmd_rsp_virt->smt_mib_get.mac_da_flag;
733 bp->stats.mac_una_da_flag = bp->cmd_rsp_virt->smt_mib_get.mac_unda_flag;
734 bp->stats.mac_frame_error_flag = bp->cmd_rsp_virt->smt_mib_get.mac_frame_error_flag;
735 bp->stats.mac_ma_unitdata_available = bp->cmd_rsp_virt->smt_mib_get.mac_ma_unitdata_available;
736 bp->stats.mac_hardware_present = bp->cmd_rsp_virt->smt_mib_get.mac_hardware_present;
737 bp->stats.mac_ma_unitdata_enable = bp->cmd_rsp_virt->smt_mib_get.mac_ma_unitdata_enable;
738 bp->stats.path_tvx_lower_bound = bp->cmd_rsp_virt->smt_mib_get.path_tvx_lower_bound;
739 bp->stats.path_t_max_lower_bound = bp->cmd_rsp_virt->smt_mib_get.path_t_max_lower_bound;
740 bp->stats.path_max_t_req = bp->cmd_rsp_virt->smt_mib_get.path_max_t_req;
741 memcpy(bp->stats.path_configuration, &bp->cmd_rsp_virt->smt_mib_get.path_configuration,
sizeof(bp->cmd_rsp_virt->smt_mib_get.path_configuration));
742 bp->stats.port_my_type[0] = bp->cmd_rsp_virt->smt_mib_get.port_my_type[0];
743 bp->stats.port_my_type[1] = bp->cmd_rsp_virt->smt_mib_get.port_my_type[1];
744 bp->stats.port_neighbor_type[0] = bp->cmd_rsp_virt->smt_mib_get.port_neighbor_type[0];
745 bp->stats.port_neighbor_type[1] = bp->cmd_rsp_virt->smt_mib_get.port_neighbor_type[1];
746 bp->stats.port_connection_policies[0] = bp->cmd_rsp_virt->smt_mib_get.port_connection_policies[0];
747 bp->stats.port_connection_policies[1] = bp->cmd_rsp_virt->smt_mib_get.port_connection_policies[1];
748 bp->stats.port_mac_indicated[0] = bp->cmd_rsp_virt->smt_mib_get.port_mac_indicated[0];
749 bp->stats.port_mac_indicated[1] = bp->cmd_rsp_virt->smt_mib_get.port_mac_indicated[1];
750 bp->stats.port_current_path[0] = bp->cmd_rsp_virt->smt_mib_get.port_current_path[0];
751 bp->stats.port_current_path[1] = bp->cmd_rsp_virt->smt_mib_get.port_current_path[1];
752 memcpy(&bp->stats.port_requested_paths[0 * 3], &bp->cmd_rsp_virt->smt_mib_get.port_requested_paths[0], 3);
753 memcpy(&bp->stats.port_requested_paths[1 * 3], &bp->cmd_rsp_virt->smt_mib_get.port_requested_paths[1], 3);
754 bp->stats.port_mac_placement[0] = bp->cmd_rsp_virt->smt_mib_get.port_mac_placement[0];
755 bp->stats.port_mac_placement[1] = bp->cmd_rsp_virt->smt_mib_get.port_mac_placement[1];
756 bp->stats.port_available_paths[0] = bp->cmd_rsp_virt->smt_mib_get.port_available_paths[0];
757 bp->stats.port_available_paths[1] = bp->cmd_rsp_virt->smt_mib_get.port_available_paths[1];
758 bp->stats.port_pmd_class[0] = bp->cmd_rsp_virt->smt_mib_get.port_pmd_class[0];
759 bp->stats.port_pmd_class[1] = bp->cmd_rsp_virt->smt_mib_get.port_pmd_class[1];
760 bp->stats.port_connection_capabilities[0] = bp->cmd_rsp_virt->smt_mib_get.port_connection_capabilities[0];
761 bp->stats.port_connection_capabilities[1] = bp->cmd_rsp_virt->smt_mib_get.port_connection_capabilities[1];
762 bp->stats.port_bs_flag[0] = bp->cmd_rsp_virt->smt_mib_get.port_bs_flag[0];
763 bp->stats.port_bs_flag[1] = bp->cmd_rsp_virt->smt_mib_get.port_bs_flag[1];
764 bp->stats.port_ler_estimate[0] = bp->cmd_rsp_virt->smt_mib_get.port_ler_estimate[0];
765 bp->stats.port_ler_estimate[1] = bp->cmd_rsp_virt->smt_mib_get.port_ler_estimate[1];
766 bp->stats.port_ler_cutoff[0] = bp->cmd_rsp_virt->smt_mib_get.port_ler_cutoff[0];
767 bp->stats.port_ler_cutoff[1] = bp->cmd_rsp_virt->smt_mib_get.port_ler_cutoff[1];
768 bp->stats.port_ler_alarm[0] = bp->cmd_rsp_virt->smt_mib_get.port_ler_alarm[0];
769 bp->stats.port_ler_alarm[1] = bp->cmd_rsp_virt->smt_mib_get.port_ler_alarm[1];
770 bp->stats.port_connect_state[0] = bp->cmd_rsp_virt->smt_mib_get.port_connect_state[0];
771 bp->stats.port_connect_state[1] = bp->cmd_rsp_virt->smt_mib_get.port_connect_state[1];
772 bp->stats.port_pcm_state[0] = bp->cmd_rsp_virt->smt_mib_get.port_pcm_state[0];
773 bp->stats.port_pcm_state[1] = bp->cmd_rsp_virt->smt_mib_get.port_pcm_state[1];
774 bp->stats.port_pc_withhold[0] = bp->cmd_rsp_virt->smt_mib_get.port_pc_withhold[0];
775 bp->stats.port_pc_withhold[1] = bp->cmd_rsp_virt->smt_mib_get.port_pc_withhold[1];
776 bp->stats.port_ler_flag[0] = bp->cmd_rsp_virt->smt_mib_get.port_ler_flag[0];
777 bp->stats.port_ler_flag[1] = bp->cmd_rsp_virt->smt_mib_get.port_ler_flag[1];
778 bp->stats.port_hardware_present[0] = bp->cmd_rsp_virt->smt_mib_get.port_hardware_present[0];
779 bp->stats.port_hardware_present[1] = bp->cmd_rsp_virt->smt_mib_get.port_hardware_present[1];
784 bp->stats.mac_frame_cts = bp->cmd_rsp_virt->cntrs_get.cntrs.frame_cnt.ls;
785 bp->stats.mac_copied_cts = bp->cmd_rsp_virt->cntrs_get.cntrs.copied_cnt.ls;
786 bp->stats.mac_transmit_cts = bp->cmd_rsp_virt->cntrs_get.cntrs.transmit_cnt.ls;
787 bp->stats.mac_error_cts = bp->cmd_rsp_virt->cntrs_get.cntrs.error_cnt.ls;
788 bp->stats.mac_lost_cts = bp->cmd_rsp_virt->cntrs_get.cntrs.lost_cnt.ls;
789 bp->stats.port_lct_fail_cts[0] = bp->cmd_rsp_virt->cntrs_get.cntrs.lct_rejects[0].ls;
790 bp->stats.port_lct_fail_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.lct_rejects[1].ls;
791 bp->stats.port_lem_reject_cts[0] = bp->cmd_rsp_virt->cntrs_get.cntrs.lem_rejects[0].ls;
792 bp->stats.port_lem_reject_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.lem_rejects[1].ls;
793 bp->stats.port_lem_cts[0] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[0].ls;
794 bp->stats.port_lem_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[1].ls;
838 static void skfp_ctl_set_multicast_list(
struct net_device *dev)
840 struct s_smc *smc = netdev_priv(dev);
845 skfp_ctl_set_multicast_list_wo_lock(dev);
846 spin_unlock_irqrestore(&bp->
DriverLock, Flags);
851 static void skfp_ctl_set_multicast_list_wo_lock(
struct net_device *dev)
853 struct s_smc *smc = netdev_priv(dev);
859 pr_debug(
"PROMISCUOUS MODE ENABLED\n");
864 pr_debug(
"PROMISCUOUS MODE DISABLED\n");
872 pr_debug(
"ENABLE ALL MC ADDRESSES\n");
883 pr_debug(
"ENABLE MC ADDRESS: %pMF\n",
890 pr_debug(
"ENABLE ALL MC ADDRESSES\n");
894 pr_debug(
"DISABLE ALL MC ADDRESSES\n");
922 static int skfp_ctl_set_mac_address(
struct net_device *dev,
void *
addr)
924 struct s_smc *smc = netdev_priv(dev);
933 spin_unlock_irqrestore(&bp->
DriverLock, Flags);
964 struct s_smc *smc = netdev_priv(dev);
986 printk(
"ioctl for %s: unknown cmd: %04x\n", dev->
name,
ioc.cmd);
1045 struct s_smc *smc = netdev_priv(dev);
1062 netif_start_queue(dev);
1068 netif_stop_queue(dev);
1073 send_queued_packets(netdev_priv(dev));
1075 netif_stop_queue(dev);
1105 static void send_queued_packets(
struct s_smc *smc)
1113 unsigned long Flags;
1135 if (!smc->ess.sync_bw_available)
1140 if (smc->
mib.fddiESSSynchTxMode) {
1154 pr_debug(
"Tx attempt while ring down.\n");
1155 }
else if ((frame_status &
OUT_OF_TXD) != 0) {
1158 pr_debug(
"%s: out of transmit resources",
1165 spin_unlock_irqrestore(&bp->
DriverLock, Flags);
1173 CheckSourceAddress(skb->
data, smc->
hw.fddi_canon_addr.a);
1177 dma_address = pci_map_single(&bp->
pdev, skb->
data,
1179 if (frame_status &
LAN_TX) {
1181 txd->
txd_os.dma_addr = dma_address;
1186 if (!(frame_status & LAN_TX)) {
1187 pci_unmap_single(&bp->
pdev, dma_address,
1191 spin_unlock_irqrestore(&bp->
DriverLock, Flags);
1206 static void CheckSourceAddress(
unsigned char *
frame,
unsigned char *hw_addr)
1208 unsigned char SRBit;
1210 if ((((
unsigned long) frame[1 + 6]) & ~0x01) != 0)
1213 if ((
unsigned short) frame[1 + 10] != 0)
1215 SRBit = frame[1 + 6] & 0x01;
1216 memcpy(&frame[1 + 6], hw_addr, 6);
1232 static void ResetAdapter(
struct s_smc *smc)
1235 pr_debug(
"[fddi: ResetAdapter]\n");
1255 skfp_ctl_set_multicast_list_wo_lock(smc->
os.dev);
1285 send_queued_packets(smc);
1287 netif_start_queue(bp->
dev);
1311 pr_debug(
"mac_drv_get_space (%d bytes), ", size);
1312 virt = (
void *) (smc->
os.SharedMemAddr + smc->
os.SharedMemHeap);
1314 if ((smc->
os.SharedMemHeap + size) > smc->
os.SharedMemSize) {
1315 printk(
"Unexpected SMT memory size requested: %d\n", size);
1318 smc->
os.SharedMemHeap +=
size;
1320 pr_debug(
"mac_drv_get_space end\n");
1323 (smc->
os.SharedMemDMA +
1324 ((
char *) virt - (
char *)smc->
os.SharedMemAddr)));
1352 pr_debug(
"mac_drv_get_desc_mem\n");
1358 size = (
u_int) (16 - (((
unsigned long) virt) & 15
UL));
1361 pr_debug(
"Allocate %u bytes alignment gap ", size);
1362 pr_debug(
"for descriptor memory.\n");
1365 printk(
"fddi: Unable to align descriptor memory.\n");
1387 return smc->
os.SharedMemDMA +
1388 ((
char *) virt - (
char *)smc->
os.SharedMemAddr);
1422 return smc->
os.SharedMemDMA +
1423 ((
char *) virt - (
char *)smc->
os.SharedMemAddr);
1470 pci_unmap_single(&bp->
pdev, r->
rxd_os.dma_addr,
1496 pr_debug(
"entering mac_drv_tx_complete\n");
1499 if (!(skb = txd->
txd_os.skb)) {
1500 pr_debug(
"TXD with no skb assigned.\n");
1506 pci_unmap_single(&smc->
os.pdev, txd->
txd_os.dma_addr,
1508 txd->
txd_os.dma_addr = 0;
1510 smc->
os.MacStat.gen.tx_packets++;
1511 smc->
os.MacStat.gen.tx_bytes+=skb->
len;
1516 pr_debug(
"leaving mac_drv_tx_complete\n");
1529 unsigned char s[255], sh[10];
1534 for (i = 0, j = 0; i < length / 8; i++, j += 8)
1536 Data[j + 0], Data[j + 1], Data[j + 2], Data[j + 3],
1537 Data[j + 4], Data[j + 5], Data[j + 6], Data[j + 7]);
1539 for (i = 0; i < length % 8; i++) {
1540 sprintf(sh,
"%02x ", Data[j + i]);
1547 #define dump_data(data,len)
1548 #endif // DUMPPACKETS
1575 int frag_count,
int len)
1579 unsigned char *virt, *
cp;
1583 pr_debug(
"entering mac_drv_rx_complete (len=%d)\n", len);
1584 if (frag_count != 1) {
1586 printk(
"fddi: Multi-fragment receive!\n");
1593 smc->
os.MacStat.gen.rx_errors++;
1628 if (len < (
int) (FDDI_MAC_HDR_LEN + RifLength)) {
1629 printk(
"fddi: Invalid RIF.\n");
1636 virt = cp + RifLength;
1637 for (n = FDDI_MAC_HDR_LEN;
n; n--)
1646 smc->
os.MacStat.gen.rx_packets++;
1648 smc->
os.MacStat.gen.rx_bytes+=
len;
1651 if (virt[1] & 0x01) {
1653 smc->
os.MacStat.gen.multicast++;
1669 smc->
os.MacStat.gen.rx_errors++;
1700 unsigned char *v_addr;
1703 if (frag_count != 1)
1705 printk(
"fddi: Multi-fragment requeue!\n");
1707 MaxFrameSize = smc->
os.MaxFrameSize;
1709 for (; frag_count > 0; frag_count--) {
1713 skb = src_rxd->
rxd_os.skb;
1716 pr_debug(
"Requeue with no skb in rxd!\n");
1717 skb = alloc_skb(MaxFrameSize + 3,
GFP_ATOMIC);
1721 skb_reserve(skb, 3);
1724 b_addr = pci_map_single(&smc->
os.pdev,
1728 rxd->
rxd_os.dma_addr = b_addr;
1731 pr_debug(
"Queueing invalid buffer!\n");
1733 v_addr = smc->
os.LocalRxBuffer;
1734 b_addr = smc->
os.LocalRxBufferDMA;
1740 b_addr = pci_map_single(&smc->
os.pdev,
1744 rxd->
rxd_os.dma_addr = b_addr;
1773 unsigned char *v_addr;
1774 unsigned long b_addr;
1778 pr_debug(
"entering mac_drv_fill_rxd\n");
1783 MaxFrameSize = smc->
os.MaxFrameSize;
1789 skb = alloc_skb(MaxFrameSize + 3,
GFP_ATOMIC);
1792 skb_reserve(skb, 3);
1795 b_addr = pci_map_single(&smc->
os.pdev,
1799 rxd->
rxd_os.dma_addr = b_addr;
1806 pr_debug(
"Queueing invalid buffer!\n");
1807 v_addr = smc->
os.LocalRxBuffer;
1808 b_addr = smc->
os.LocalRxBufferDMA;
1817 pr_debug(
"leaving mac_drv_fill_rxd\n");
1843 pr_debug(
"entering mac_drv_clear_rxd\n");
1845 if (frag_count != 1)
1847 printk(
"fddi: Multi-fragment clear!\n");
1849 for (; frag_count > 0; frag_count--) {
1855 pci_unmap_single(&bp->
pdev, rxd->
rxd_os.dma_addr,
1895 char *look_ahead,
int la_len)
1899 pr_debug(
"entering mac_drv_rx_init(len=%d)\n", len);
1904 pr_debug(
"fddi: Discard invalid local SMT frame\n");
1905 pr_debug(
" len=%d, la_len=%d, (ULONG) look_ahead=%08lXh.\n",
1906 len, la_len, (
unsigned long) look_ahead);
1911 pr_debug(
"fddi: Local SMT: skb memory exhausted.\n");
1914 skb_reserve(skb, 3);
1916 skb_copy_to_linear_data(skb, look_ahead, len);
1961 pr_debug(
"ring_status_indication( ");
2040 pr_debug(
"Ring operational change.\n");
2043 pr_debug(
"Receive fifo overflow.\n");
2044 smc->
os.MacStat.gen.rx_errors++;
2047 pr_debug(
"Unknown status (%d).\n", stat);
2097 s =
"SC10_C_WRAP_B";
2100 s =
"SC11_C_WRAP_S";
2103 pr_debug(
"cfm_state_change: unknown %d\n", c_state);
2106 pr_debug(
"cfm_state_change: %s\n", s);
2107 #endif // DRIVERDEBUG
2146 s =
"EC4_PATH_TEST";
2161 pr_debug(
"ecm_state_change: %s\n", s);
2162 #endif //DRIVERDEBUG
2192 s =
"RM1_NON_OP - not operational";
2195 s =
"RM2_RING_OP - ring operational";
2198 s =
"RM3_DETECT - detect dupl addresses";
2201 s =
"RM4_NON_OP_DUP - dupl. addr detected";
2204 s =
"RM5_RING_OP_DUP - ring oper. with dupl. addr";
2207 s =
"RM6_DIRECTED - sending directed beacons";
2210 s =
"RM7_TRACE - trace initiated";
2216 pr_debug(
"[rmt_state_change: %s]\n", s);
2217 #endif // DRIVERDEBUG
2236 pr_debug(
"entering drv_reset_indication\n");
2238 smc->
os.ResetRequested =
TRUE;
2242 static struct pci_driver skfddi_pci_driver = {
2244 .id_table = skfddi_pci_tbl,
2245 .probe = skfp_init_one,
2249 static int __init skfd_init(
void)
2251 return pci_register_driver(&skfddi_pci_driver);
2254 static void __exit skfd_exit(
void)