29 static const char ID_sccs[] =
"@(#)drvfbi.c 1.63 99/02/11 (C) SK " ;
38 #define LED_Y_OFF 0x10
41 #define MS2BCLK(x) ((x)*12500L)
67 #define OEMID(smc,i) oem_id[ID_BYTE0 + i]
69 const struct s_oem_ids oem_ids[] = {
73 #define OEMID(smc,i) smc->hw.oem_id->oi_id[i]
78 extern int AIX_vpdReadByte() ;
83 static void smt_stop_watchdog(
struct s_smc *
smc);
88 static void card_start(
struct s_smc *
smc)
96 smt_stop_watchdog(smc) ;
104 hwt_wait_time(smc,hwt_quick_read(smc),
MS2BCLK(10)) ;
126 outp(
ADDR(B0_CTRL), CTRL_MRST_CLR|CTRL_HPI_CLR) ;
135 if ((rev_id & 0xf0) == SK_ML_ID_1 || (rev_id & 0xf0) == SK_ML_ID_2) {
136 smc->
hw.hw_is_64bit =
TRUE ;
144 if (!smc->
hw.hw_is_64bit) {
165 smt_stop_watchdog(smc) ;
166 smc->
hw.mac_ring_is_up = 0 ;
174 hwt_wait_time(smc,hwt_quick_read(smc),
MS2BCLK(10)) ;
260 smc->
hw.t_stop = smc->
hw.t_start;
280 #define STATION_LABEL_CONNECTOR_OFFSET 5
281 #define STATION_LABEL_PMD_OFFSET 6
282 #define STATION_LABEL_PORT_OFFSET 7
291 for (i = 0; i < 6; i++) {
292 smc->
hw.fddi_phys_addr.a[
i] =
293 bitrev8(
inp(
ADDR(B2_MAC_0+i)));
306 for (i = 0; i < 6 ;i++) {
307 smc->
hw.fddi_canon_addr.a[
i] = mac_addr[
i] ;
308 smc->
hw.fddi_home_addr.a[
i] = bitrev8(mac_addr[i]);
312 smc->
hw.fddi_home_addr = smc->
hw.fddi_phys_addr ;
314 for (i = 0; i < 6 ;i++) {
315 smc->
hw.fddi_canon_addr.a[
i] =
316 bitrev8(smc->
hw.fddi_phys_addr.a[i]);
328 if (!(
inp(
ADDR(B0_DAS)) & DAS_AVAIL))
333 if (!(
inp(
ADDR(B0_DAS)) & DAS_BYP_ST))
334 smc->
mib.fddiSMTBypassPresent = 0 ;
337 smc->
mib.fddiSMTBypassPresent = 1 ;
347 "BP_INSERT" :
"BP_DEINSERT",0) ;
391 static void led_indication(
struct s_smc *smc,
int led_event)
398 struct fddi_mib_p *mib_a ;
399 struct fddi_mib_p *mib_b ;
411 led_state |= LED_MY_ON ;
414 led_state |= LED_MY_OFF ;
419 led_state |= LED_GA_ON ;
422 led_state |= LED_GA_OFF ;
427 led_state |= LED_GB_ON ;
430 led_state |= LED_GB_OFF ;
449 led_indication(smc,0) ;
468 extern int load_gen_flag ;
473 smc->
hw.n_a_send= 0 ;
480 static int is_equal_num(
char comp1[],
char comp2[],
int num)
484 for (i = 0 ; i < num ; i++) {
485 if (comp1[i] != comp2[i])
501 int set_oi_id_def(
struct s_smc *smc)
509 act_entries =
FALSE ;
511 smc->
hw.oem_min_status = OI_STAT_ACTIVE ;
514 while (oem_ids[i].oi_status) {
515 switch (oem_ids[i].oi_status) {
521 case OI_STAT_PRESENT:
535 smc->
hw.oem_id = (
struct s_oem_ids *) &oem_ids[sel_id] ;
544 for (i = 0 ; i < 6 ; i++)
545 bia_addr->
a[i] = bitrev8(smc->
hw.fddi_phys_addr.a[i]);
555 if (smc->
hw.wdog_used) {
563 static void smt_stop_watchdog(
struct s_smc *smc)
569 if (smc->
hw.wdog_used) {
579 void mac_do_pci_fix(
struct s_smc *smc)