• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/net/skfp/

Lines Matching refs:smc

23 #include "h/smc.h"
81 #define OEMID(smc,i) oem_id[ID_BYTE0 + i]
87 #define OEMID(smc,i) smc->hw.oem_id->oi_id[i]
97 static void smt_stop_watchdog(struct s_smc *smc);
110 #define read_POS(smc,a1,a2) ((u_char) inp(a1))
111 #define write_POS(smc,a1,a2,a3) outp((a1),(a3))
119 static void card_start(struct s_smc *smc)
127 smt_stop_watchdog(smc) ;
144 smc->hw.led = (2<<6) ;
145 outpw(CSR_A,CS_CRESET | smc->hw.led) ;
180 hwt_wait_time(smc,hwt_quick_read(smc),MS2BCLK(10)) ;
212 smc->hw.hw_is_64bit = TRUE ;
214 smc->hw.hw_is_64bit = FALSE ;
220 if (!smc->hw.hw_is_64bit) {
233 smc->hw.is_imask = ISR_MASK ;
234 smc->hw.hw_state = STOPPED ;
239 void card_stop(struct s_smc *smc)
241 smt_stop_watchdog(smc) ;
242 smc->hw.mac_ring_is_up = 0 ; /* ring down */
258 hwt_wait_time(smc,hwt_quick_read(smc),MS2BCLK(10)) ;
265 smc->hw.hw_state = STOPPED ;
270 void mac1_irq(struct s_smc *smc, u_short stu, u_short stl)
283 SMT_PANIC(smc,SMT_E0132, SMT_E0132_MSG) ;
289 SMT_PANIC(smc,SMT_E0133, SMT_E0133_MSG) ;
299 formac_tx_restart(smc) ; /* init tx */
312 smc->hw.n_a_send = 0 ;
313 if (++smc->hw.fp.tx_free < smc->hw.fp.tx_max) {
314 start_next_send(smc);
325 llc_restart_tx(smc) ;
335 SMT_PANIC(smc,SMT_E0134, SMT_E0134_MSG) ;
343 SMT_PANIC(smc,SMT_E0133, SMT_E0133_MSG) ;
351 formac_tx_restart(smc) ; /* init tx */
366 llc_restart_tx(smc) ;
373 void plc1_irq(struct s_smc *smc)
381 plc_irq(smc,PB,st) ;
388 void plc2_irq(struct s_smc *smc)
396 plc_irq(smc,PA,st) ;
403 void timer_irq(struct s_smc *smc)
405 hwt_restart(smc);
406 smc->hw.t_stop = smc->hw.t_start;
407 smt_timer_done(smc) ;
413 int pcm_get_s_port(struct s_smc *smc)
415 SK_UNUSED(smc) ;
430 void read_address(struct s_smc *smc, u_char *mac_addr)
438 smc->hw.fddi_phys_addr.a[i] =
442 smc->hw.fddi_phys_addr.a[i] =
452 smc->hw.fddi_phys_addr.a[i] =
456 smc->hw.fddi_phys_addr.a[i] =
462 smc->hw.fddi_phys_addr.a[i] =
474 smc->y[PA].pmd_type[PMD_SK_CONN] =
475 smc->y[PB].pmd_type[PMD_SK_CONN] = ConnectorType ;
476 smc->y[PA].pmd_type[PMD_SK_PMD ] =
477 smc->y[PB].pmd_type[PMD_SK_PMD ] = PmdType ;
481 smc->hw.fddi_canon_addr.a[i] = mac_addr[i] ;
482 smc->hw.fddi_home_addr.a[i] = bitrev8(mac_addr[i]);
486 smc->hw.fddi_home_addr = smc->hw.fddi_phys_addr ;
489 smc->hw.fddi_canon_addr.a[i] =
490 bitrev8(smc->hw.fddi_phys_addr.a[i]);
497 void init_board(struct s_smc *smc, u_char *mac_addr)
499 card_start(smc) ;
500 read_address(smc,mac_addr) ;
507 smc->s.sas = SMT_SAS ; /* Single att. station */
509 smc->s.sas = SMT_DAS ; /* Dual att. station */
516 smc->mib.fddiSMTBypassPresent = 0 ;
519 smc->mib.fddiSMTBypassPresent = 1 ;
526 void sm_pm_bypass_req(struct s_smc *smc, int mode)
535 if (smc->s.sas != SMT_DAS)
542 csra_v |= smc->hw.led ;
579 int sm_pm_bypass_present(struct s_smc *smc)
588 void plc_clear_irq(struct s_smc *smc, int p)
604 SK_UNUSED(smc) ;
614 * smc: SMT context
620 static void led_indication(struct s_smc *smc, int led_event)
622 /* use smc->hw.mac_ring_is_up == TRUE
630 phy = &smc->y[PA] ;
632 phy = &smc->y[PB] ;
638 smc->hw.led |= CS_LED_1 ;
641 smc->hw.led &= ~CS_LED_1 ;
647 smc->hw.led |= CS_LED_0 ;
650 smc->hw.led &= ~CS_LED_0 ;
714 void pcm_state_change(struct s_smc *smc, int plc, int p_state)
721 DRV_PCM_STATE_CHANGE(smc,plc,p_state) ;
723 led_indication(smc,0) ;
727 void rmt_indication(struct s_smc *smc, int i)
730 DRV_RMT_INDICATION(smc,i) ;
732 led_indication(smc, i ? LED_Y_OFF : LED_Y_ON) ;
739 void llc_recover_tx(struct s_smc *smc)
747 smc->hw.n_a_send= 0 ;
749 SK_UNUSED(smc) ;
775 int set_oi_id_def(struct s_smc *smc)
784 smc->hw.oem_id = 0 ;
785 smc->hw.oem_min_status = OI_STAT_ACTIVE ;
809 smc->hw.oem_id = (struct s_oem_ids *) &oem_ids[sel_id] ;
825 * struct s_smc *smc,
828 * smc - A pointer to the SMT Context struct.
843 * The smc pointer must be valid now.
849 int exist_board(struct s_smc *smc, int slot)
857 if (smc == NULL)
861 if (read_card_id(smc, slot)
862 == LONG_CARD_ID(OEMID(smc,0), OEMID(smc,1)))
866 idi = read_card_id(smc, slot) ;
870 smc->hw.oem_id = (struct s_oem_ids *) &oem_ids[0] ;
871 for (; smc->hw.oem_id->oi_status != OI_STAT_LAST; smc->hw.oem_id++) {
872 if (smc->hw.oem_id->oi_status < smc->hw.oem_min_status)
875 if (is_equal_num(&id[0],&OEMID(smc,0),2))
888 * smc - A pointer to the SMT Context struct.
899 static int read_card_id(struct s_smc *smc, int slot)
900 /* struct s_smc *smc ; Do not use. */
904 SK_UNUSED(smc) ; /* Make LINT happy. */
908 EnableSlotAccess(smc, slot) ;
910 card_id = ((read_POS(smc,POS_ID_HIGH,slot - 1) & 0xff) << 8) |
911 (read_POS(smc,POS_ID_LOW,slot - 1) & 0xff) ;
913 DisableSlotAccess(smc) ;
925 * parameters within the 'smc' structure.
928 * struct s_smc *smc,
931 * smc - A pointer to the SMT Context struct, to which this function will
943 int get_board_para(struct s_smc *smc, int slot)
949 switch (exist_board(smc, slot)) {
953 smc->hw.rev = FM1_REV ;
954 smc->hw.VFullRead = 0x0a ;
955 smc->hw.VFullWrite = 0x05 ;
956 smc->hw.DmaWriteExtraBytes = 8 ; /* 2 extra words. */
959 smc->hw.slot = slot ;
961 EnableSlotAccess(smc, slot) ;
963 if (!(read_POS(smc,POS_102, slot - 1) & POS_CARD_EN)) {
964 DisableSlotAccess(smc) ;
968 val = read_POS(smc,POS_104, slot - 1) ; /* I/O, IRQ */
972 smc->hw.iop = (i + 1) * 0x0400 - 0x200 ;
975 smc->hw.irq = opt_ints[i] ;
978 i = ((read_POS(smc,POS_103, slot - 1) & POS_MSEL) >> 4) & 0x07 ;
979 smc->hw.eprom = opt_eproms[i] ;
981 DisableSlotAccess(smc) ;
983 /* before this, the smc->hw.iop must be set !!! */
984 smc->hw.slot_32 = inpw(CSF_A) & SLOT_32 ;
990 static void EnableSlotAccess(struct s_smc *smc, int slot)
995 SK_UNUSED(smc) ;
1003 attach_POS_addr (smc) ;
1008 static void DisableSlotAccess(struct s_smc *smc)
1011 SK_UNUSED(smc) ;
1015 detach_POS_addr (smc) ;
1024 #define SADDR(slot) (smc->hw.iop)
1036 * struct s_smc *smc,
1039 * smc - A pointer to the SMT Context struct.
1054 * The smc pointer must be valid now.
1057 int exist_board(struct s_smc *smc, int slot)
1065 if (smc == NULL)
1072 if (inp(SADDR(slot)+PRA(i)) != OEMID(smc,i))
1080 smc->hw.oem_id = (struct s_oem_ids *) &oem_ids[0] ;
1082 for (; smc->hw.oem_id->oi_status != OI_STAT_LAST; smc->hw.oem_id++) {
1083 if (smc->hw.oem_id->oi_status < smc->hw.oem_min_status)
1086 if (is_equal_num(&id[0],&OEMID(smc,0),4))
1094 int get_board_para(struct s_smc *smc, int slot)
1098 if (!exist_board(smc,slot))
1101 smc->hw.slot = slot ;
1103 smc->hw.iop = SADDR(slot) ;
1110 smc->hw.irq = opt_ints[(inp(C1_A(0)) & CFG_IRQ_SEL)] ;
1111 smc->hw.dma = opt_dmas[((inp(C1_A(0)) & CFG_DRQ_SEL)>>3)] ;
1114 smc->hw.eprom = opt_eproms[i] ;
1116 smc->hw.eprom = 0 ;
1118 smc->hw.DmaWriteExtraBytes = 8 ;
1127 #define SIZE_SKLOGO(smc) sizeof(sklogo)
1128 #define SKLOGO(smc,i) sklogo[i]
1130 #define SIZE_SKLOGO(smc) smc->hw.oem_id->oi_logo_len
1131 #define SKLOGO(smc,i) smc->hw.oem_id->oi_logo[i]
1135 int exist_board(struct s_smc *smc, HW_PTR port)
1145 if (smc == NULL)
1148 SK_UNUSED(smc) ;
1150 for (i = SADDRL ; i < (signed) (SADDRL+SIZE_SKLOGO(smc)) ; i++) {
1151 if ((u_char)inpw((PRA(i)+port)) != SKLOGO(smc,i-SADDRL)) {
1158 if ((u_char)inpw((PRA(i)+port)) != OEMID(smc,i))
1163 smc->hw.oem_id = (struct s_oem_ids *) &oem_ids[0] ;
1167 for (; smc->hw.oem_id->oi_status != OI_STAT_LAST; smc->hw.oem_id++) {
1168 if (smc->hw.oem_id->oi_status < smc->hw.oem_min_status)
1172 /* for (i=0; (i<bytes_read) && (i < SIZE_SKLOGO(smc)); i++) { */
1174 if (board_logo[i] != SKLOGO(smc,i))
1179 if ((board_logo[i] != SKLOGO(smc,i)) && (i < bytes_read))
1183 while (bytes_read < SIZE_SKLOGO(smc)) {
1188 if (board_logo[i] != SKLOGO(smc,i))
1195 if ((board_logo[i] == SKLOGO(smc,i))
1196 && (bytes_read == SIZE_SKLOGO(smc))) {
1198 if (is_equal_num(&id[0],&OEMID(smc,0),3))
1206 int get_board_para(struct s_smc *smc, int slot)
1208 SK_UNUSED(smc) ;
1216 int exist_board(struct s_smc *smc, int slot)
1227 smc->hw.oem_id = (struct s_oem_ids *) &oem_ids[0] ;
1228 for (; smc->hw.oem_id->oi_status != OI_STAT_LAST; smc->hw.oem_id++) {
1229 if (smc->hw.oem_id->oi_status < smc->hw.oem_min_status)
1232 ven_id = OEMID(smc,0) + (OEMID(smc,1) << 8) ;
1233 dev_id = OEMID(smc,2) + (OEMID(smc,3) << 8) ;
1235 if (pci_find_device(i,&smc->hw.pci_handle,
1254 void driver_get_bia(struct s_smc *smc, struct fddi_addr *bia_addr)
1259 bia_addr->a[i] = bitrev8(smc->hw.fddi_phys_addr.a[i]);
1262 void smt_start_watchdog(struct s_smc *smc)
1264 SK_UNUSED(smc) ; /* Make LINT happy. */
1269 if (smc->hw.wdog_used) {
1277 static void smt_stop_watchdog(struct s_smc *smc)
1279 SK_UNUSED(smc) ; /* Make LINT happy. */
1283 if (smc->hw.wdog_used) {
1293 void mac_do_pci_fix(struct s_smc *smc)
1295 SK_UNUSED(smc) ;