X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fnet%2Fskfp%2Fpcmplc.c;h=4be8f3a9e8f40f0d807ef753a34f4040c6f163b9;hb=5e3b93f248c98873cc843e83092bb8da92ac85a2;hp=571f055c096bacca88967d49c88ba6446c426131;hpb=a91482bdcc2e0f6035702e46f1b99043a0893346;p=linux-2.6.git diff --git a/drivers/net/skfp/pcmplc.c b/drivers/net/skfp/pcmplc.c index 571f055c0..4be8f3a9e 100644 --- a/drivers/net/skfp/pcmplc.c +++ b/drivers/net/skfp/pcmplc.c @@ -199,25 +199,28 @@ static int plc_imsk_act = PL_PCM_CODE | PL_TRACE_PROP | PL_PCM_BREAK | PL_PCM_ENABLED | PL_SELF_TEST | PL_EBUF_ERR; /* external functions */ -void all_selection_criteria(struct s_smc *smc); +void all_selection_criteria (); /* internal functions */ -static void pcm_fsm(struct s_smc *smc, struct s_phy *phy, int cmd); -static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy); -static void pc_tcode_actions(struct s_smc *smc, const int bit, struct s_phy *phy); -static void reset_lem_struct(struct s_phy *phy); -static void plc_init(struct s_smc *smc, int p); -static void sm_ph_lem_start(struct s_smc *smc, int np, int threshold); -static void sm_ph_lem_stop(struct s_smc *smc, int np); -static void sm_ph_linestate(struct s_smc *smc, int phy, int ls); -static void real_init_plc(struct s_smc *smc); +static void pcm_fsm() ; +static void pc_rcode_actions() ; +static void pc_tcode_actions() ; +static void reset_lem_struct() ; +static void plc_init() ; +static void sm_ph_lem_start() ; +static void sm_ph_lem_stop() ; +static void sm_ph_linestate() ; +static void real_init_plc() ; /* * SMT timer interface * start PCM timer 0 */ -static void start_pcm_timer0(struct s_smc *smc, u_long value, int event, - struct s_phy *phy) +static void start_pcm_timer0(smc,value,event,phy) +struct s_smc *smc ; +u_long value; +int event; +struct s_phy *phy; { phy->timer0_exp = FALSE ; /* clear timer event flag */ smt_timer_start(smc,&phy->pcm_timer0,value, @@ -227,7 +230,9 @@ static void start_pcm_timer0(struct s_smc *smc, u_long value, int event, * SMT timer interface * stop PCM timer 0 */ -static void stop_pcm_timer0(struct s_smc *smc, struct s_phy *phy) +static void stop_pcm_timer0(smc,phy) +struct s_smc *smc ; +struct s_phy *phy; { if (phy->pcm_timer0.tm_active) smt_timer_stop(smc,&phy->pcm_timer0) ; @@ -237,7 +242,8 @@ static void stop_pcm_timer0(struct s_smc *smc, struct s_phy *phy) init PCM state machine (called by driver) clear all PCM vars and flags */ -void pcm_init(struct s_smc *smc) +void pcm_init(smc) +struct s_smc *smc ; { int i ; int np ; @@ -401,7 +407,8 @@ void pcm_init(struct s_smc *smc) real_init_plc(smc) ; } -void init_plc(struct s_smc *smc) +void init_plc(smc) +struct s_smc *smc ; { SK_UNUSED(smc) ; @@ -414,7 +421,8 @@ void init_plc(struct s_smc *smc) */ } -static void real_init_plc(struct s_smc *smc) +static void real_init_plc(smc) +struct s_smc *smc ; { int p ; @@ -422,7 +430,9 @@ static void real_init_plc(struct s_smc *smc) plc_init(smc,p) ; } -static void plc_init(struct s_smc *smc, int p) +static void plc_init(smc,p) +struct s_smc *smc ; +int p; { int i ; #ifndef MOT_ELM @@ -485,7 +495,10 @@ static void plc_init(struct s_smc *smc, int p) /* * control PCM state machine */ -static void plc_go_state(struct s_smc *smc, int p, int state) +static void plc_go_state(smc,p,state) +struct s_smc *smc ; +int p; +int state; { HW_PTR port ; int val ; @@ -501,7 +514,9 @@ static void plc_go_state(struct s_smc *smc, int p, int state) /* * read current line state (called by ECM & PCM) */ -int sm_pm_get_ls(struct s_smc *smc, int phy) +int sm_pm_get_ls(smc,phy) +struct s_smc *smc ; +int phy; { int state ; @@ -534,7 +549,10 @@ int sm_pm_get_ls(struct s_smc *smc, int phy) return(state) ; } -static int plc_send_bits(struct s_smc *smc, struct s_phy *phy, int len) +static int plc_send_bits(smc,phy,len) +struct s_smc *smc ; +struct s_phy *phy; +int len; { int np = phy->np ; /* PHY index */ int n ; @@ -571,7 +589,9 @@ static int plc_send_bits(struct s_smc *smc, struct s_phy *phy, int len) /* * config plc muxes */ -void plc_config_mux(struct s_smc *smc, int mux) +void plc_config_mux(smc,mux) +struct s_smc *smc ; +int mux ; { if (smc->s.sas != SMT_DAS) return ; @@ -595,7 +615,10 @@ void plc_config_mux(struct s_smc *smc, int mux) process event until SM is stable */ -void pcm(struct s_smc *smc, const int np, int event) +void pcm(smc,np,event) +struct s_smc *smc ; +const int np; +int event; { int state ; int oldstate ; @@ -674,7 +697,10 @@ void pcm(struct s_smc *smc, const int np, int event) /* * PCM state machine */ -static void pcm_fsm(struct s_smc *smc, struct s_phy *phy, int cmd) +static void pcm_fsm(smc,phy,cmd) +struct s_smc *smc ; +struct s_phy *phy; +int cmd; { int i ; int np = phy->np ; /* PHY index */ @@ -1037,7 +1063,10 @@ static void pcm_fsm(struct s_smc *smc, struct s_phy *phy, int cmd) /* * force line state on a PHY output (only in MAINT state) */ -static void sm_ph_linestate(struct s_smc *smc, int phy, int ls) +static void sm_ph_linestate(smc,phy,ls) +struct s_smc *smc ; +int phy; +int ls; { int cntrl ; @@ -1066,7 +1095,9 @@ static void sm_ph_linestate(struct s_smc *smc, int phy, int ls) outpw(PLC(phy,PL_CNTRL_B),cntrl) ; } -static void reset_lem_struct(struct s_phy *phy) + +static void reset_lem_struct(phy) +struct s_phy *phy; { struct lem_counter *lem = &phy->lem ; @@ -1077,7 +1108,9 @@ static void reset_lem_struct(struct s_phy *phy) /* * link error monitor */ -static void lem_evaluate(struct s_smc *smc, struct s_phy *phy) +static void lem_evaluate(smc,phy) +struct s_smc *smc ; +struct s_phy *phy; { int ber ; u_long errors ; @@ -1177,7 +1210,8 @@ static void lem_evaluate(struct s_smc *smc, struct s_phy *phy) /* * called by SMT to calculate LEM bit error rate */ -void sm_lem_evaluate(struct s_smc *smc) +void sm_lem_evaluate(smc) +struct s_smc *smc ; { int np ; @@ -1185,7 +1219,9 @@ void sm_lem_evaluate(struct s_smc *smc) lem_evaluate(smc,&smc->y[np]) ; } -static void lem_check_lct(struct s_smc *smc, struct s_phy *phy) +static void lem_check_lct(smc,phy) +struct s_smc *smc ; +struct s_phy *phy ; { struct lem_counter *lem = &phy->lem ; struct fddi_mib_p *mib ; @@ -1229,7 +1265,10 @@ static void lem_check_lct(struct s_smc *smc, struct s_phy *phy) /* * LEM functions */ -static void sm_ph_lem_start(struct s_smc *smc, int np, int threshold) +static void sm_ph_lem_start(smc,np,threshold) +struct s_smc *smc ; +int np; +int threshold; { struct lem_counter *lem = &smc->y[np].lem ; @@ -1247,7 +1286,9 @@ static void sm_ph_lem_start(struct s_smc *smc, int np, int threshold) SETMASK(PLC(np,PL_INTR_MASK),PL_LE_CTR,PL_LE_CTR) ; } -static void sm_ph_lem_stop(struct s_smc *smc, int np) +static void sm_ph_lem_stop(smc,np) +struct s_smc *smc ; +int np; { struct lem_counter *lem = &smc->y[np].lem ; @@ -1256,8 +1297,10 @@ static void sm_ph_lem_stop(struct s_smc *smc, int np) } /* ARGSUSED */ -void sm_pm_ls_latch(struct s_smc *smc, int phy, int on_off) -/* int on_off; en- or disable ident. ls */ +void sm_pm_ls_latch(smc,phy,on_off) +struct s_smc *smc ; +int phy; +int on_off; /* en- or disable ident. ls */ { SK_UNUSED(smc) ; @@ -1274,7 +1317,10 @@ void sm_pm_ls_latch(struct s_smc *smc, int phy, int on_off) /* * PCM pseudo code 5.1 .. 6.1 */ -static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy) +static void pc_rcode_actions(smc,bit,phy) +struct s_smc *smc ; +int bit; +struct s_phy *phy; { struct fddi_mib_p *mib ; @@ -1410,7 +1456,10 @@ static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy) /* * PCM pseudo code 5.1 .. 6.1 */ -static void pc_tcode_actions(struct s_smc *smc, const int bit, struct s_phy *phy) +static void pc_tcode_actions(smc,bit,phy) +struct s_smc *smc ; +const int bit; +struct s_phy *phy; { int np = phy->np ; struct fddi_mib_p *mib ; @@ -1589,7 +1638,8 @@ static void pc_tcode_actions(struct s_smc *smc, const int bit, struct s_phy *phy /* * return status twisted (called by SMT) */ -int pcm_status_twisted(struct s_smc *smc) +int pcm_status_twisted(smc) +struct s_smc *smc ; { int twist = 0 ; if (smc->s.sas != SMT_DAS) @@ -1608,8 +1658,13 @@ int pcm_status_twisted(struct s_smc *smc) * remote phy type * remote mac yes/no */ -void pcm_status_state(struct s_smc *smc, int np, int *type, int *state, - int *remote, int *mac) +void pcm_status_state(smc,np,type,state,remote,mac) +struct s_smc *smc ; +int np; +int *type; +int *state; +int *remote; +int *mac; { struct s_phy *phy = &smc->y[np] ; struct fddi_mib_p *mib ; @@ -1632,7 +1687,8 @@ void pcm_status_state(struct s_smc *smc, int np, int *type, int *state, /* * return rooted station status (called by SMT) */ -int pcm_rooted_station(struct s_smc *smc) +int pcm_rooted_station(smc) +struct s_smc *smc ; { int n ; @@ -1647,8 +1703,10 @@ int pcm_rooted_station(struct s_smc *smc) /* * Interrupt actions for PLC & PCM events */ -void plc_irq(struct s_smc *smc, int np, unsigned int cmd) -/* int np; PHY index */ +void plc_irq(smc,np,cmd) +struct s_smc *smc ; +int np; /* PHY index */ +unsigned int cmd; { struct s_phy *phy = &smc->y[np] ; struct s_plc *plc = &phy->plc ; @@ -1861,7 +1919,9 @@ void plc_irq(struct s_smc *smc, int np, unsigned int cmd) #endif } -void pcm_set_lct_short(struct s_smc *smc, int n) +void pcm_set_lct_short(smc,n) +struct s_smc *smc ; +int n ; { if (n <= 0 || n > 1000) return ; @@ -1872,7 +1932,9 @@ void pcm_set_lct_short(struct s_smc *smc, int n) /* * fill state struct */ -void pcm_get_state(struct s_smc *smc, struct smt_state *state) +void pcm_get_state(smc,state) +struct s_smc *smc ; +struct smt_state *state ; { struct s_phy *phy ; struct pcm_state *pcs ; @@ -1906,7 +1968,9 @@ void pcm_get_state(struct s_smc *smc, struct smt_state *state) } } -int get_pcm_state(struct s_smc *smc, int np) +int get_pcm_state(smc,np) +struct s_smc *smc ; +int np; { int pcs ; @@ -1928,7 +1992,9 @@ int get_pcm_state(struct s_smc *smc, int np) return(pcs) ; } -char *get_linestate(struct s_smc *smc, int np) +char *get_linestate(smc,np) +struct s_smc *smc ; +int np; { char *ls = "" ; @@ -1950,7 +2016,9 @@ char *get_linestate(struct s_smc *smc, int np) return(ls) ; } -char *get_pcmstate(struct s_smc *smc, int np) +char *get_pcmstate(smc,np) +struct s_smc *smc ; +int np; { char *pcs ; @@ -1972,7 +2040,8 @@ char *get_pcmstate(struct s_smc *smc, int np) return(pcs) ; } -void list_phy(struct s_smc *smc) +void list_phy(smc) +struct s_smc *smc ; { struct s_plc *plc ; int np ; @@ -2000,7 +2069,8 @@ void list_phy(struct s_smc *smc) #ifdef CONCENTRATOR -void pcm_lem_dump(struct s_smc *smc) +void pcm_lem_dump(smc) +struct s_smc *smc ; { int i ; struct s_phy *phy ;