aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/skfp
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/net/skfp
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'drivers/net/skfp')
-rw-r--r--drivers/net/skfp/Makefile2
-rw-r--r--drivers/net/skfp/cfm.c10
-rw-r--r--drivers/net/skfp/drvfbi.c16
-rw-r--r--drivers/net/skfp/ess.c54
-rw-r--r--drivers/net/skfp/fplustm.c30
-rw-r--r--drivers/net/skfp/h/cmtdef.h4
-rw-r--r--drivers/net/skfp/h/fplustm.h4
-rw-r--r--drivers/net/skfp/h/smc.h2
-rw-r--r--drivers/net/skfp/h/smt.h2
-rw-r--r--drivers/net/skfp/h/supern_2.h4
-rw-r--r--drivers/net/skfp/hwmtm.c32
-rw-r--r--drivers/net/skfp/hwt.c6
-rw-r--r--drivers/net/skfp/pcmplc.c28
-rw-r--r--drivers/net/skfp/pmf.c62
-rw-r--r--drivers/net/skfp/queue.c2
-rw-r--r--drivers/net/skfp/skfddi.c120
-rw-r--r--drivers/net/skfp/smt.c84
-rw-r--r--drivers/net/skfp/smtdef.c4
-rw-r--r--drivers/net/skfp/smtinit.c2
-rw-r--r--drivers/net/skfp/srf.c2
20 files changed, 234 insertions, 236 deletions
diff --git a/drivers/net/skfp/Makefile b/drivers/net/skfp/Makefile
index cb23580fcffa..b0be0234abf6 100644
--- a/drivers/net/skfp/Makefile
+++ b/drivers/net/skfp/Makefile
@@ -17,4 +17,4 @@ skfp-objs := skfddi.o hwmtm.o fplustm.o smt.o cfm.o \
17# projects. To keep the source common for all those drivers (and 17# projects. To keep the source common for all those drivers (and
18# thus simplify fixes to it), please do not clean it up! 18# thus simplify fixes to it), please do not clean it up!
19 19
20EXTRA_CFLAGS += -Idrivers/net/skfp -DPCI -DMEM_MAPPED_IO -Wno-strict-prototypes 20ccflags-y := -Idrivers/net/skfp -DPCI -DMEM_MAPPED_IO -Wno-strict-prototypes
diff --git a/drivers/net/skfp/cfm.c b/drivers/net/skfp/cfm.c
index 5310d39b5737..e395ace3120b 100644
--- a/drivers/net/skfp/cfm.c
+++ b/drivers/net/skfp/cfm.c
@@ -542,8 +542,8 @@ static void cfm_fsm(struct s_smc *smc, int cmd)
542 */ 542 */
543int cfm_get_mac_input(struct s_smc *smc) 543int cfm_get_mac_input(struct s_smc *smc)
544{ 544{
545 return((smc->mib.fddiSMTCF_State == SC10_C_WRAP_B || 545 return (smc->mib.fddiSMTCF_State == SC10_C_WRAP_B ||
546 smc->mib.fddiSMTCF_State == SC5_THRU_B) ? PB : PA) ; 546 smc->mib.fddiSMTCF_State == SC5_THRU_B) ? PB : PA;
547} 547}
548 548
549/* 549/*
@@ -553,8 +553,8 @@ int cfm_get_mac_input(struct s_smc *smc)
553 */ 553 */
554int cfm_get_mac_output(struct s_smc *smc) 554int cfm_get_mac_output(struct s_smc *smc)
555{ 555{
556 return((smc->mib.fddiSMTCF_State == SC10_C_WRAP_B || 556 return (smc->mib.fddiSMTCF_State == SC10_C_WRAP_B ||
557 smc->mib.fddiSMTCF_State == SC4_THRU_A) ? PB : PA) ; 557 smc->mib.fddiSMTCF_State == SC4_THRU_A) ? PB : PA;
558} 558}
559 559
560static char path_iso[] = { 560static char path_iso[] = {
@@ -623,5 +623,5 @@ int cem_build_path(struct s_smc *smc, char *to, int path_index)
623 623
624 LINT_USE(path_index); 624 LINT_USE(path_index);
625 625
626 return(len) ; 626 return len;
627} 627}
diff --git a/drivers/net/skfp/drvfbi.c b/drivers/net/skfp/drvfbi.c
index c77cc14b3227..07da97c303d6 100644
--- a/drivers/net/skfp/drvfbi.c
+++ b/drivers/net/skfp/drvfbi.c
@@ -267,7 +267,7 @@ void timer_irq(struct s_smc *smc)
267int pcm_get_s_port(struct s_smc *smc) 267int pcm_get_s_port(struct s_smc *smc)
268{ 268{
269 SK_UNUSED(smc) ; 269 SK_UNUSED(smc) ;
270 return(PS) ; 270 return PS;
271} 271}
272 272
273/* 273/*
@@ -366,7 +366,7 @@ void sm_pm_bypass_req(struct s_smc *smc, int mode)
366 */ 366 */
367int sm_pm_bypass_present(struct s_smc *smc) 367int sm_pm_bypass_present(struct s_smc *smc)
368{ 368{
369 return( (inp(ADDR(B0_DAS)) & DAS_BYP_ST) ? TRUE: FALSE) ; 369 return (inp(ADDR(B0_DAS)) & DAS_BYP_ST) ? TRUE : FALSE;
370} 370}
371 371
372void plc_clear_irq(struct s_smc *smc, int p) 372void plc_clear_irq(struct s_smc *smc, int p)
@@ -483,9 +483,9 @@ static int is_equal_num(char comp1[], char comp2[], int num)
483 483
484 for (i = 0 ; i < num ; i++) { 484 for (i = 0 ; i < num ; i++) {
485 if (comp1[i] != comp2[i]) 485 if (comp1[i] != comp2[i])
486 return (0) ; 486 return 0;
487 } 487 }
488 return (1) ; 488 return 1;
489} /* is_equal_num */ 489} /* is_equal_num */
490 490
491 491
@@ -522,18 +522,18 @@ int set_oi_id_def(struct s_smc *smc)
522 i++ ; 522 i++ ;
523 break ; /* entry ok */ 523 break ; /* entry ok */
524 default: 524 default:
525 return (1) ; /* invalid oi_status */ 525 return 1; /* invalid oi_status */
526 } 526 }
527 } 527 }
528 528
529 if (i == 0) 529 if (i == 0)
530 return (2) ; 530 return 2;
531 if (!act_entries) 531 if (!act_entries)
532 return (3) ; 532 return 3;
533 533
534 /* ok, we have a valid OEM data base with an active entry */ 534 /* ok, we have a valid OEM data base with an active entry */
535 smc->hw.oem_id = (struct s_oem_ids *) &oem_ids[sel_id] ; 535 smc->hw.oem_id = (struct s_oem_ids *) &oem_ids[sel_id] ;
536 return (0) ; 536 return 0;
537} 537}
538#endif /* MULT_OEM */ 538#endif /* MULT_OEM */
539 539
diff --git a/drivers/net/skfp/ess.c b/drivers/net/skfp/ess.c
index e8387d25f24a..2fc5987b41dc 100644
--- a/drivers/net/skfp/ess.c
+++ b/drivers/net/skfp/ess.c
@@ -135,7 +135,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
135 */ 135 */
136 if (!(p = (void *) sm_to_para(smc,sm,SMT_P0015))) { 136 if (!(p = (void *) sm_to_para(smc,sm,SMT_P0015))) {
137 DB_ESS("ESS: RAF frame error, parameter type not found\n",0,0) ; 137 DB_ESS("ESS: RAF frame error, parameter type not found\n",0,0) ;
138 return(fs) ; 138 return fs;
139 } 139 }
140 msg_res_type = ((struct smt_p_0015 *)p)->res_type ; 140 msg_res_type = ((struct smt_p_0015 *)p)->res_type ;
141 141
@@ -147,7 +147,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
147 * error in frame: para ESS command was not found 147 * error in frame: para ESS command was not found
148 */ 148 */
149 DB_ESS("ESS: RAF frame error, parameter command not found\n",0,0); 149 DB_ESS("ESS: RAF frame error, parameter command not found\n",0,0);
150 return(fs) ; 150 return fs;
151 } 151 }
152 152
153 DB_ESSN(2,"fc %x ft %x\n",sm->smt_class,sm->smt_type) ; 153 DB_ESSN(2,"fc %x ft %x\n",sm->smt_class,sm->smt_type) ;
@@ -175,12 +175,12 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
175 * local and no static allocation is used 175 * local and no static allocation is used
176 */ 176 */
177 if (!local || smc->mib.fddiESSPayload) 177 if (!local || smc->mib.fddiESSPayload)
178 return(fs) ; 178 return fs;
179 179
180 p = (void *) sm_to_para(smc,sm,SMT_P0019) ; 180 p = (void *) sm_to_para(smc,sm,SMT_P0019) ;
181 for (i = 0; i < 5; i++) { 181 for (i = 0; i < 5; i++) {
182 if (((struct smt_p_0019 *)p)->alloc_addr.a[i]) { 182 if (((struct smt_p_0019 *)p)->alloc_addr.a[i]) {
183 return(fs) ; 183 return fs;
184 } 184 }
185 } 185 }
186 186
@@ -199,10 +199,10 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
199 sm->smt_dest = smt_sba_da ; 199 sm->smt_dest = smt_sba_da ;
200 200
201 if (smc->ess.local_sba_active) 201 if (smc->ess.local_sba_active)
202 return(fs | I_INDICATOR) ; 202 return fs | I_INDICATOR;
203 203
204 if (!(db = smt_get_mbuf(smc))) 204 if (!(db = smt_get_mbuf(smc)))
205 return(fs) ; 205 return fs;
206 206
207 db->sm_len = mb->sm_len ; 207 db->sm_len = mb->sm_len ;
208 db->sm_off = mb->sm_off ; 208 db->sm_off = mb->sm_off ;
@@ -212,7 +212,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
212 (struct smt_header *)(db->sm_data+db->sm_off), 212 (struct smt_header *)(db->sm_data+db->sm_off),
213 "RAF") ; 213 "RAF") ;
214 smt_send_frame(smc,db,FC_SMT_INFO,0) ; 214 smt_send_frame(smc,db,FC_SMT_INFO,0) ;
215 return(fs) ; 215 return fs;
216 } 216 }
217 217
218 /* 218 /*
@@ -221,7 +221,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
221 */ 221 */
222 if (smt_check_para(smc,sm,plist_raf_alc_res)) { 222 if (smt_check_para(smc,sm,plist_raf_alc_res)) {
223 DB_ESS("ESS: RAF with para problem, ignoring\n",0,0) ; 223 DB_ESS("ESS: RAF with para problem, ignoring\n",0,0) ;
224 return(fs) ; 224 return fs;
225 } 225 }
226 226
227 /* 227 /*
@@ -241,8 +241,8 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
241 != SMT_RDF_SUCCESS) || 241 != SMT_RDF_SUCCESS) ||
242 (sm->smt_tid != smc->ess.alloc_trans_id)) { 242 (sm->smt_tid != smc->ess.alloc_trans_id)) {
243 243
244 DB_ESS("ESS: Allocation Responce not accepted\n",0,0) ; 244 DB_ESS("ESS: Allocation Response not accepted\n",0,0) ;
245 return(fs) ; 245 return fs;
246 } 246 }
247 247
248 /* 248 /*
@@ -268,7 +268,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
268 */ 268 */
269 (void)process_bw_alloc(smc,(long)payload,(long)overhead) ; 269 (void)process_bw_alloc(smc,(long)payload,(long)overhead) ;
270 270
271 return(fs) ; 271 return fs;
272 /* end of Process Allocation Request */ 272 /* end of Process Allocation Request */
273 273
274 /* 274 /*
@@ -280,7 +280,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
280 */ 280 */
281 if (sm->smt_type != SMT_REQUEST) { 281 if (sm->smt_type != SMT_REQUEST) {
282 DB_ESS("ESS: Do not process Change Responses\n",0,0) ; 282 DB_ESS("ESS: Do not process Change Responses\n",0,0) ;
283 return(fs) ; 283 return fs;
284 } 284 }
285 285
286 /* 286 /*
@@ -288,7 +288,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
288 */ 288 */
289 if (smt_check_para(smc,sm,plist_raf_chg_req)) { 289 if (smt_check_para(smc,sm,plist_raf_chg_req)) {
290 DB_ESS("ESS: RAF with para problem, ignoring\n",0,0) ; 290 DB_ESS("ESS: RAF with para problem, ignoring\n",0,0) ;
291 return(fs) ; 291 return fs;
292 } 292 }
293 293
294 /* 294 /*
@@ -300,7 +300,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
300 if ((((struct smt_p_320b *)sm_to_para(smc,sm,SMT_P320B))->path_index 300 if ((((struct smt_p_320b *)sm_to_para(smc,sm,SMT_P320B))->path_index
301 != PRIMARY_RING) || (msg_res_type != SYNC_BW)) { 301 != PRIMARY_RING) || (msg_res_type != SYNC_BW)) {
302 DB_ESS("ESS: RAF frame with para problem, ignoring\n",0,0) ; 302 DB_ESS("ESS: RAF frame with para problem, ignoring\n",0,0) ;
303 return(fs) ; 303 return fs;
304 } 304 }
305 305
306 /* 306 /*
@@ -319,14 +319,14 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
319 * process the bandwidth allocation 319 * process the bandwidth allocation
320 */ 320 */
321 if(!process_bw_alloc(smc,(long)payload,(long)overhead)) 321 if(!process_bw_alloc(smc,(long)payload,(long)overhead))
322 return(fs) ; 322 return fs;
323 323
324 /* 324 /*
325 * send an RAF Change Reply 325 * send an RAF Change Reply
326 */ 326 */
327 ess_send_response(smc,sm,CHANGE_ALLOCATION) ; 327 ess_send_response(smc,sm,CHANGE_ALLOCATION) ;
328 328
329 return(fs) ; 329 return fs;
330 /* end of Process Change Request */ 330 /* end of Process Change Request */
331 331
332 /* 332 /*
@@ -338,7 +338,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
338 */ 338 */
339 if (sm->smt_type != SMT_REQUEST) { 339 if (sm->smt_type != SMT_REQUEST) {
340 DB_ESS("ESS: Do not process a Report Reply\n",0,0) ; 340 DB_ESS("ESS: Do not process a Report Reply\n",0,0) ;
341 return(fs) ; 341 return fs;
342 } 342 }
343 343
344 DB_ESSN(2,"ESS: Report Request from %s\n", 344 DB_ESSN(2,"ESS: Report Request from %s\n",
@@ -349,7 +349,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
349 */ 349 */
350 if (msg_res_type != SYNC_BW) { 350 if (msg_res_type != SYNC_BW) {
351 DB_ESS("ESS: ignoring RAF with para problem\n",0,0) ; 351 DB_ESS("ESS: ignoring RAF with para problem\n",0,0) ;
352 return(fs) ; 352 return fs;
353 } 353 }
354 354
355 /* 355 /*
@@ -357,7 +357,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
357 */ 357 */
358 ess_send_response(smc,sm,REPORT_ALLOCATION) ; 358 ess_send_response(smc,sm,REPORT_ALLOCATION) ;
359 359
360 return(fs) ; 360 return fs;
361 /* end of Process Report Request */ 361 /* end of Process Report Request */
362 362
363 default: 363 default:
@@ -368,7 +368,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
368 break ; 368 break ;
369 } 369 }
370 370
371 return(fs) ; 371 return fs;
372} 372}
373 373
374/* 374/*
@@ -393,7 +393,7 @@ static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhe
393 * | T-NEG | 393 * | T-NEG |
394 * - - 394 * - -
395 * 395 *
396 * T-NEG is discribed by the equation: 396 * T-NEG is described by the equation:
397 * 397 *
398 * (-) fddiMACT-NEG 398 * (-) fddiMACT-NEG
399 * T-NEG = ------------------- 399 * T-NEG = -------------------
@@ -418,17 +418,17 @@ static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhe
418 */ 418 */
419/* if (smt_set_obj(smc,SMT_P320F,payload,S_SET)) { 419/* if (smt_set_obj(smc,SMT_P320F,payload,S_SET)) {
420 DB_ESS("ESS: SMT does not accept the payload value\n",0,0) ; 420 DB_ESS("ESS: SMT does not accept the payload value\n",0,0) ;
421 return(FALSE) ; 421 return FALSE;
422 } 422 }
423 if (smt_set_obj(smc,SMT_P3210,overhead,S_SET)) { 423 if (smt_set_obj(smc,SMT_P3210,overhead,S_SET)) {
424 DB_ESS("ESS: SMT does not accept the overhead value\n",0,0) ; 424 DB_ESS("ESS: SMT does not accept the overhead value\n",0,0) ;
425 return(FALSE) ; 425 return FALSE;
426 } */ 426 } */
427 427
428 /* premliminary */ 428 /* premliminary */
429 if (payload > MAX_PAYLOAD || overhead > 5000) { 429 if (payload > MAX_PAYLOAD || overhead > 5000) {
430 DB_ESS("ESS: payload / overhead not accepted\n",0,0) ; 430 DB_ESS("ESS: payload / overhead not accepted\n",0,0) ;
431 return(FALSE) ; 431 return FALSE;
432 } 432 }
433 433
434 /* 434 /*
@@ -468,7 +468,7 @@ static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhe
468 468
469 ess_config_fifo(smc) ; 469 ess_config_fifo(smc) ;
470 set_formac_tsync(smc,smc->ess.sync_bw) ; 470 set_formac_tsync(smc,smc->ess.sync_bw) ;
471 return(TRUE) ; 471 return TRUE;
472} 472}
473 473
474static void ess_send_response(struct s_smc *smc, struct smt_header *sm, 474static void ess_send_response(struct s_smc *smc, struct smt_header *sm,
@@ -479,7 +479,7 @@ static void ess_send_response(struct s_smc *smc, struct smt_header *sm,
479 void *p ; 479 void *p ;
480 480
481 /* 481 /*
482 * get and initialize the responce frame 482 * get and initialize the response frame
483 */ 483 */
484 if (sba_cmd == CHANGE_ALLOCATION) { 484 if (sba_cmd == CHANGE_ALLOCATION) {
485 if (!(mb=smt_build_frame(smc,SMT_RAF,SMT_REPLY, 485 if (!(mb=smt_build_frame(smc,SMT_RAF,SMT_REPLY,
@@ -578,7 +578,7 @@ static void ess_send_alc_req(struct s_smc *smc)
578 } 578 }
579 579
580 /* 580 /*
581 * get and initialize the responce frame 581 * get and initialize the response frame
582 */ 582 */
583 if (!(mb=smt_build_frame(smc,SMT_RAF,SMT_REQUEST, 583 if (!(mb=smt_build_frame(smc,SMT_RAF,SMT_REQUEST,
584 sizeof(struct smt_sba_alc_req)))) 584 sizeof(struct smt_sba_alc_req))))
diff --git a/drivers/net/skfp/fplustm.c b/drivers/net/skfp/fplustm.c
index 9d8d1ac48176..a20ed1a98099 100644
--- a/drivers/net/skfp/fplustm.c
+++ b/drivers/net/skfp/fplustm.c
@@ -112,8 +112,8 @@ static u_long mac_get_tneg(struct s_smc *smc)
112 u_long tneg ; 112 u_long tneg ;
113 113
114 tneg = (u_long)((long)inpw(FM_A(FM_TNEG))<<5) ; 114 tneg = (u_long)((long)inpw(FM_A(FM_TNEG))<<5) ;
115 return((u_long)((tneg + ((inpw(FM_A(FM_TMRS))>>10)&0x1f)) | 115 return (u_long)((tneg + ((inpw(FM_A(FM_TMRS))>>10)&0x1f)) |
116 0xffe00000L)) ; 116 0xffe00000L) ;
117} 117}
118 118
119void mac_update_counter(struct s_smc *smc) 119void mac_update_counter(struct s_smc *smc)
@@ -163,7 +163,7 @@ static u_long read_mdr(struct s_smc *smc, unsigned int addr)
163 /* is used */ 163 /* is used */
164 p = (u_long)inpw(FM_A(FM_MDRU))<<16 ; 164 p = (u_long)inpw(FM_A(FM_MDRU))<<16 ;
165 p += (u_long)inpw(FM_A(FM_MDRL)) ; 165 p += (u_long)inpw(FM_A(FM_MDRL)) ;
166 return(p) ; 166 return p;
167} 167}
168#endif 168#endif
169 169
@@ -340,7 +340,7 @@ static void mac_counter_init(struct s_smc *smc)
340 outpw(FM_A(FM_LCNTR),0) ; 340 outpw(FM_A(FM_LCNTR),0) ;
341 outpw(FM_A(FM_ECNTR),0) ; 341 outpw(FM_A(FM_ECNTR),0) ;
342 /* 342 /*
343 * clear internal error counter stucture 343 * clear internal error counter structure
344 */ 344 */
345 ec = (u_long *)&smc->hw.fp.err_stats ; 345 ec = (u_long *)&smc->hw.fp.err_stats ;
346 for (i = (sizeof(struct err_st)/sizeof(long)) ; i ; i--) 346 for (i = (sizeof(struct err_st)/sizeof(long)) ; i ; i--)
@@ -887,7 +887,7 @@ int init_fplus(struct s_smc *smc)
887 /* make sure all PCI settings are correct */ 887 /* make sure all PCI settings are correct */
888 mac_do_pci_fix(smc) ; 888 mac_do_pci_fix(smc) ;
889 889
890 return(init_mac(smc,1)) ; 890 return init_mac(smc, 1);
891 /* enable_formac(smc) ; */ 891 /* enable_formac(smc) ; */
892} 892}
893 893
@@ -989,7 +989,7 @@ static int init_mac(struct s_smc *smc, int all)
989 } 989 }
990 smc->hw.hw_state = STARTED ; 990 smc->hw.hw_state = STARTED ;
991 991
992 return(0) ; 992 return 0;
993} 993}
994 994
995 995
@@ -1049,7 +1049,7 @@ void sm_ma_control(struct s_smc *smc, int mode)
1049 1049
1050int sm_mac_get_tx_state(struct s_smc *smc) 1050int sm_mac_get_tx_state(struct s_smc *smc)
1051{ 1051{
1052 return((inpw(FM_A(FM_STMCHN))>>4)&7) ; 1052 return (inpw(FM_A(FM_STMCHN))>>4) & 7;
1053} 1053}
1054 1054
1055/* 1055/*
@@ -1084,9 +1084,9 @@ static struct s_fpmc* mac_get_mc_table(struct s_smc *smc,
1084 } 1084 }
1085 if (memcmp((char *)&tb->a,(char *)own,6)) 1085 if (memcmp((char *)&tb->a,(char *)own,6))
1086 continue ; 1086 continue ;
1087 return(tb) ; 1087 return tb;
1088 } 1088 }
1089 return(slot) ; /* return first free or NULL */ 1089 return slot; /* return first free or NULL */
1090} 1090}
1091 1091
1092/* 1092/*
@@ -1152,12 +1152,12 @@ int mac_add_multicast(struct s_smc *smc, struct fddi_addr *addr, int can)
1152 */ 1152 */
1153 if (can & 0x80) { 1153 if (can & 0x80) {
1154 if (smc->hw.fp.smt_slots_used >= SMT_MAX_MULTI) { 1154 if (smc->hw.fp.smt_slots_used >= SMT_MAX_MULTI) {
1155 return(1) ; 1155 return 1;
1156 } 1156 }
1157 } 1157 }
1158 else { 1158 else {
1159 if (smc->hw.fp.os_slots_used >= FPMAX_MULTICAST-SMT_MAX_MULTI) { 1159 if (smc->hw.fp.os_slots_used >= FPMAX_MULTICAST-SMT_MAX_MULTI) {
1160 return(1) ; 1160 return 1;
1161 } 1161 }
1162 } 1162 }
1163 1163
@@ -1165,7 +1165,7 @@ int mac_add_multicast(struct s_smc *smc, struct fddi_addr *addr, int can)
1165 * find empty slot 1165 * find empty slot
1166 */ 1166 */
1167 if (!(tb = mac_get_mc_table(smc,addr,&own,0,can & ~0x80))) 1167 if (!(tb = mac_get_mc_table(smc,addr,&own,0,can & ~0x80)))
1168 return(1) ; 1168 return 1;
1169 tb->n++ ; 1169 tb->n++ ;
1170 tb->a = own ; 1170 tb->a = own ;
1171 tb->perm = (can & 0x80) ? 1 : 0 ; 1171 tb->perm = (can & 0x80) ? 1 : 0 ;
@@ -1175,7 +1175,7 @@ int mac_add_multicast(struct s_smc *smc, struct fddi_addr *addr, int can)
1175 else 1175 else
1176 smc->hw.fp.os_slots_used++ ; 1176 smc->hw.fp.os_slots_used++ ;
1177 1177
1178 return(0) ; 1178 return 0;
1179} 1179}
1180 1180
1181/* 1181/*
@@ -1262,8 +1262,8 @@ Function DOWNCALL/INTERN (SMT, fplustm.c)
1262 1262
1263Para mode = 1 RX_ENABLE_ALLMULTI enable all multicasts 1263Para mode = 1 RX_ENABLE_ALLMULTI enable all multicasts
1264 2 RX_DISABLE_ALLMULTI disable "enable all multicasts" 1264 2 RX_DISABLE_ALLMULTI disable "enable all multicasts"
1265 3 RX_ENABLE_PROMISC enable promiscous 1265 3 RX_ENABLE_PROMISC enable promiscuous
1266 4 RX_DISABLE_PROMISC disable promiscous 1266 4 RX_DISABLE_PROMISC disable promiscuous
1267 5 RX_ENABLE_NSA enable reception of NSA frames 1267 5 RX_ENABLE_NSA enable reception of NSA frames
1268 6 RX_DISABLE_NSA disable reception of NSA frames 1268 6 RX_DISABLE_NSA disable reception of NSA frames
1269 1269
diff --git a/drivers/net/skfp/h/cmtdef.h b/drivers/net/skfp/h/cmtdef.h
index f2f771d8be76..5a6c6122ccb0 100644
--- a/drivers/net/skfp/h/cmtdef.h
+++ b/drivers/net/skfp/h/cmtdef.h
@@ -19,7 +19,7 @@
19 19
20/* 20/*
21 * implementation specific constants 21 * implementation specific constants
22 * MODIIFY THE FOLLWOING THREE DEFINES 22 * MODIIFY THE FOLLOWING THREE DEFINES
23 */ 23 */
24#define AMDPLC /* if Amd PLC chip used */ 24#define AMDPLC /* if Amd PLC chip used */
25#ifdef CONC 25#ifdef CONC
@@ -456,7 +456,7 @@ struct s_plc {
456 u_long soft_err ; /* error counter */ 456 u_long soft_err ; /* error counter */
457 u_long parity_err ; /* error counter */ 457 u_long parity_err ; /* error counter */
458 u_long ebuf_err ; /* error counter */ 458 u_long ebuf_err ; /* error counter */
459 u_long ebuf_cont ; /* continous error counter */ 459 u_long ebuf_cont ; /* continuous error counter */
460 u_long phyinv ; /* error counter */ 460 u_long phyinv ; /* error counter */
461 u_long vsym_ctr ; /* error counter */ 461 u_long vsym_ctr ; /* error counter */
462 u_long mini_ctr ; /* error counter */ 462 u_long mini_ctr ; /* error counter */
diff --git a/drivers/net/skfp/h/fplustm.h b/drivers/net/skfp/h/fplustm.h
index 6d738e1e2393..d43191ed938b 100644
--- a/drivers/net/skfp/h/fplustm.h
+++ b/drivers/net/skfp/h/fplustm.h
@@ -237,8 +237,8 @@ struct s_smt_fp {
237 */ 237 */
238#define RX_ENABLE_ALLMULTI 1 /* enable all multicasts */ 238#define RX_ENABLE_ALLMULTI 1 /* enable all multicasts */
239#define RX_DISABLE_ALLMULTI 2 /* disable "enable all multicasts" */ 239#define RX_DISABLE_ALLMULTI 2 /* disable "enable all multicasts" */
240#define RX_ENABLE_PROMISC 3 /* enable promiscous */ 240#define RX_ENABLE_PROMISC 3 /* enable promiscuous */
241#define RX_DISABLE_PROMISC 4 /* disable promiscous */ 241#define RX_DISABLE_PROMISC 4 /* disable promiscuous */
242#define RX_ENABLE_NSA 5 /* enable reception of NSA frames */ 242#define RX_ENABLE_NSA 5 /* enable reception of NSA frames */
243#define RX_DISABLE_NSA 6 /* disable reception of NSA frames */ 243#define RX_DISABLE_NSA 6 /* disable reception of NSA frames */
244 244
diff --git a/drivers/net/skfp/h/smc.h b/drivers/net/skfp/h/smc.h
index 026a83b9f743..c774a95902f5 100644
--- a/drivers/net/skfp/h/smc.h
+++ b/drivers/net/skfp/h/smc.h
@@ -388,7 +388,7 @@ struct smt_config {
388 u_long rmt_t_poll ; /* RMT : claim/beacon poller */ 388 u_long rmt_t_poll ; /* RMT : claim/beacon poller */
389 u_long rmt_dup_mac_behavior ; /* Flag for the beavior of SMT if 389 u_long rmt_dup_mac_behavior ; /* Flag for the beavior of SMT if
390 * a Duplicate MAC Address was detected. 390 * a Duplicate MAC Address was detected.
391 * FALSE: SMT will leave finaly the ring 391 * FALSE: SMT will leave finally the ring
392 * TRUE: SMT will reinstert into the ring 392 * TRUE: SMT will reinstert into the ring
393 */ 393 */
394 u_long mac_d_max ; /* MAC : D_Max timer value */ 394 u_long mac_d_max ; /* MAC : D_Max timer value */
diff --git a/drivers/net/skfp/h/smt.h b/drivers/net/skfp/h/smt.h
index 2976757a36fb..2030f9cbb24b 100644
--- a/drivers/net/skfp/h/smt.h
+++ b/drivers/net/skfp/h/smt.h
@@ -793,7 +793,7 @@ struct smt_rdf {
793} ; 793} ;
794 794
795/* 795/*
796 * SBA Request Allocation Responce Frame 796 * SBA Request Allocation Response Frame
797 */ 797 */
798struct smt_sba_alc_res { 798struct smt_sba_alc_res {
799 struct smt_header smt ; /* generic header */ 799 struct smt_header smt ; /* generic header */
diff --git a/drivers/net/skfp/h/supern_2.h b/drivers/net/skfp/h/supern_2.h
index 5ba0b8306753..0b73690280f6 100644
--- a/drivers/net/skfp/h/supern_2.h
+++ b/drivers/net/skfp/h/supern_2.h
@@ -14,7 +14,7 @@
14 14
15/* 15/*
16 defines for AMD Supernet II chip set 16 defines for AMD Supernet II chip set
17 the chips are refered to as 17 the chips are referred to as
18 FPLUS Formac Plus 18 FPLUS Formac Plus
19 PLC Physical Layer 19 PLC Physical Layer
20 20
@@ -386,7 +386,7 @@ struct tx_queue {
386#define FM_MDISRCV (4<<8) /* disable receive function */ 386#define FM_MDISRCV (4<<8) /* disable receive function */
387#define FM_MRES0 (5<<8) /* reserve */ 387#define FM_MRES0 (5<<8) /* reserve */
388#define FM_MLIMPROM (6<<8) /* limited-promiscuous mode */ 388#define FM_MLIMPROM (6<<8) /* limited-promiscuous mode */
389#define FM_MPROMISCOUS (7<<8) /* address detection : promiscous */ 389#define FM_MPROMISCOUS (7<<8) /* address detection : promiscuous */
390 390
391#define FM_SELSA 0x0800 /* select-short-address bit */ 391#define FM_SELSA 0x0800 /* select-short-address bit */
392 392
diff --git a/drivers/net/skfp/hwmtm.c b/drivers/net/skfp/hwmtm.c
index d322f1b702ac..e26398b5a7dc 100644
--- a/drivers/net/skfp/hwmtm.c
+++ b/drivers/net/skfp/hwmtm.c
@@ -232,16 +232,16 @@ u_int mac_drv_check_space(void)
232#ifdef COMMON_MB_POOL 232#ifdef COMMON_MB_POOL
233 call_count++ ; 233 call_count++ ;
234 if (call_count == 1) { 234 if (call_count == 1) {
235 return(EXT_VIRT_MEM) ; 235 return EXT_VIRT_MEM;
236 } 236 }
237 else { 237 else {
238 return(EXT_VIRT_MEM_2) ; 238 return EXT_VIRT_MEM_2;
239 } 239 }
240#else 240#else
241 return (EXT_VIRT_MEM) ; 241 return EXT_VIRT_MEM;
242#endif 242#endif
243#else 243#else
244 return (0) ; 244 return 0;
245#endif 245#endif
246} 246}
247 247
@@ -271,7 +271,7 @@ int mac_drv_init(struct s_smc *smc)
271 if (!(smc->os.hwm.descr_p = (union s_fp_descr volatile *) 271 if (!(smc->os.hwm.descr_p = (union s_fp_descr volatile *)
272 mac_drv_get_desc_mem(smc,(u_int) 272 mac_drv_get_desc_mem(smc,(u_int)
273 (RXD_TXD_COUNT+1)*sizeof(struct s_smt_fp_txd)))) { 273 (RXD_TXD_COUNT+1)*sizeof(struct s_smt_fp_txd)))) {
274 return(1) ; /* no space the hwm modul can't work */ 274 return 1; /* no space the hwm modul can't work */
275 } 275 }
276 276
277 /* 277 /*
@@ -283,18 +283,18 @@ int mac_drv_init(struct s_smc *smc)
283#ifndef COMMON_MB_POOL 283#ifndef COMMON_MB_POOL
284 if (!(smc->os.hwm.mbuf_pool.mb_start = (SMbuf *) mac_drv_get_space(smc, 284 if (!(smc->os.hwm.mbuf_pool.mb_start = (SMbuf *) mac_drv_get_space(smc,
285 MAX_MBUF*sizeof(SMbuf)))) { 285 MAX_MBUF*sizeof(SMbuf)))) {
286 return(1) ; /* no space the hwm modul can't work */ 286 return 1; /* no space the hwm modul can't work */
287 } 287 }
288#else 288#else
289 if (!mb_start) { 289 if (!mb_start) {
290 if (!(mb_start = (SMbuf *) mac_drv_get_space(smc, 290 if (!(mb_start = (SMbuf *) mac_drv_get_space(smc,
291 MAX_MBUF*sizeof(SMbuf)))) { 291 MAX_MBUF*sizeof(SMbuf)))) {
292 return(1) ; /* no space the hwm modul can't work */ 292 return 1; /* no space the hwm modul can't work */
293 } 293 }
294 } 294 }
295#endif 295#endif
296#endif 296#endif
297 return (0) ; 297 return 0;
298} 298}
299 299
300/* 300/*
@@ -349,7 +349,7 @@ static u_long init_descr_ring(struct s_smc *smc,
349 DRV_BUF_FLUSH(&d1->r,DDI_DMA_SYNC_FORDEV) ; 349 DRV_BUF_FLUSH(&d1->r,DDI_DMA_SYNC_FORDEV) ;
350 d1++; 350 d1++;
351 } 351 }
352 return(phys) ; 352 return phys;
353} 353}
354 354
355static void init_txd_ring(struct s_smc *smc) 355static void init_txd_ring(struct s_smc *smc)
@@ -502,7 +502,7 @@ SMbuf *smt_get_mbuf(struct s_smc *smc)
502 mb->sm_use_count = 1 ; 502 mb->sm_use_count = 1 ;
503 } 503 }
504 DB_GEN("get SMbuf: mb = %x",(void *)mb,0,3) ; 504 DB_GEN("get SMbuf: mb = %x",(void *)mb,0,3) ;
505 return (mb) ; /* May be NULL */ 505 return mb; /* May be NULL */
506} 506}
507 507
508void smt_free_mbuf(struct s_smc *smc, SMbuf *mb) 508void smt_free_mbuf(struct s_smc *smc, SMbuf *mb)
@@ -621,7 +621,7 @@ static u_long repair_txd_ring(struct s_smc *smc, struct s_smt_tx_queue *queue)
621 t = t->txd_next ; 621 t = t->txd_next ;
622 tx_used-- ; 622 tx_used-- ;
623 } 623 }
624 return(phys) ; 624 return phys;
625} 625}
626 626
627/* 627/*
@@ -673,7 +673,7 @@ static u_long repair_rxd_ring(struct s_smc *smc, struct s_smt_rx_queue *queue)
673 r = r->rxd_next ; 673 r = r->rxd_next ;
674 rx_used-- ; 674 rx_used-- ;
675 } 675 }
676 return(phys) ; 676 return phys;
677} 677}
678 678
679 679
@@ -691,7 +691,7 @@ static u_long repair_rxd_ring(struct s_smc *smc, struct s_smt_rx_queue *queue)
691 * interrupt service routine, handles the interrupt requests 691 * interrupt service routine, handles the interrupt requests
692 * generated by the FDDI adapter. 692 * generated by the FDDI adapter.
693 * 693 *
694 * NOTE: The operating system dependent module must garantee that the 694 * NOTE: The operating system dependent module must guarantee that the
695 * interrupts of the adapter are disabled when it calls fddi_isr. 695 * interrupts of the adapter are disabled when it calls fddi_isr.
696 * 696 *
697 * About the USE_BREAK_ISR mechanismn: 697 * About the USE_BREAK_ISR mechanismn:
@@ -1595,7 +1595,7 @@ int hwm_tx_init(struct s_smc *smc, u_char fc, int frag_count, int frame_len,
1595 } 1595 }
1596 DB_TX("frame_status = %x",frame_status,0,3) ; 1596 DB_TX("frame_status = %x",frame_status,0,3) ;
1597 NDD_TRACE("THiE",frame_status,smc->os.hwm.tx_p->tx_free,0) ; 1597 NDD_TRACE("THiE",frame_status,smc->os.hwm.tx_p->tx_free,0) ;
1598 return(frame_status) ; 1598 return frame_status;
1599} 1599}
1600 1600
1601/* 1601/*
@@ -1764,7 +1764,7 @@ static SMbuf *get_llc_rx(struct s_smc *smc)
1764 smc->os.hwm.llc_rx_pipe = mb->sm_next ; 1764 smc->os.hwm.llc_rx_pipe = mb->sm_next ;
1765 } 1765 }
1766 DB_GEN("get_llc_rx: mb = 0x%x",(void *)mb,0,4) ; 1766 DB_GEN("get_llc_rx: mb = 0x%x",(void *)mb,0,4) ;
1767 return(mb) ; 1767 return mb;
1768} 1768}
1769 1769
1770/* 1770/*
@@ -1797,7 +1797,7 @@ static SMbuf *get_txd_mb(struct s_smc *smc)
1797 smc->os.hwm.txd_tx_pipe = mb->sm_next ; 1797 smc->os.hwm.txd_tx_pipe = mb->sm_next ;
1798 } 1798 }
1799 DB_GEN("get_txd_mb: mb = 0x%x",(void *)mb,0,4) ; 1799 DB_GEN("get_txd_mb: mb = 0x%x",(void *)mb,0,4) ;
1800 return(mb) ; 1800 return mb;
1801} 1801}
1802 1802
1803/* 1803/*
diff --git a/drivers/net/skfp/hwt.c b/drivers/net/skfp/hwt.c
index 053151468f93..c0798fd2ca69 100644
--- a/drivers/net/skfp/hwt.c
+++ b/drivers/net/skfp/hwt.c
@@ -179,7 +179,7 @@ u_long hwt_read(struct s_smc *smc)
179 else 179 else
180 smc->hw.t_stop = smc->hw.t_start - tr ; 180 smc->hw.t_stop = smc->hw.t_start - tr ;
181 } 181 }
182 return (smc->hw.t_stop) ; 182 return smc->hw.t_stop;
183} 183}
184 184
185#ifdef PCI 185#ifdef PCI
@@ -208,7 +208,7 @@ u_long hwt_quick_read(struct s_smc *smc)
208 outpw(ADDR(B2_TI_CRTL), TIM_START) ; 208 outpw(ADDR(B2_TI_CRTL), TIM_START) ;
209 outpd(ADDR(B2_TI_INI),interval) ; 209 outpd(ADDR(B2_TI_INI),interval) ;
210 210
211 return(time) ; 211 return time;
212} 212}
213 213
214/************************ 214/************************
@@ -221,7 +221,7 @@ u_long hwt_quick_read(struct s_smc *smc)
221 * para start start time 221 * para start start time
222 * duration time to wait 222 * duration time to wait
223 * 223 *
224 * NOTE: The fuction will return immediately, if the timer is not 224 * NOTE: The function will return immediately, if the timer is not
225 * started 225 * started
226 ************************/ 226 ************************/
227void hwt_wait_time(struct s_smc *smc, u_long start, long int duration) 227void hwt_wait_time(struct s_smc *smc, u_long start, long int duration)
diff --git a/drivers/net/skfp/pcmplc.c b/drivers/net/skfp/pcmplc.c
index ba45bc794d77..88d02d0a42c4 100644
--- a/drivers/net/skfp/pcmplc.c
+++ b/drivers/net/skfp/pcmplc.c
@@ -504,7 +504,7 @@ int sm_pm_get_ls(struct s_smc *smc, int phy)
504 504
505#ifdef CONCENTRATOR 505#ifdef CONCENTRATOR
506 if (!plc_is_installed(smc,phy)) 506 if (!plc_is_installed(smc,phy))
507 return(PC_QLS) ; 507 return PC_QLS;
508#endif 508#endif
509 509
510 state = inpw(PLC(phy,PL_STATUS_A)) & PL_LINE_ST ; 510 state = inpw(PLC(phy,PL_STATUS_A)) & PL_LINE_ST ;
@@ -528,7 +528,7 @@ int sm_pm_get_ls(struct s_smc *smc, int phy)
528 default : 528 default :
529 state = PC_LS_NONE ; 529 state = PC_LS_NONE ;
530 } 530 }
531 return(state) ; 531 return state;
532} 532}
533 533
534static int plc_send_bits(struct s_smc *smc, struct s_phy *phy, int len) 534static int plc_send_bits(struct s_smc *smc, struct s_phy *phy, int len)
@@ -547,7 +547,7 @@ static int plc_send_bits(struct s_smc *smc, struct s_phy *phy, int len)
547#if 0 547#if 0
548 printf("PL_PCM_SIGNAL is set\n") ; 548 printf("PL_PCM_SIGNAL is set\n") ;
549#endif 549#endif
550 return(1) ; 550 return 1;
551 } 551 }
552 /* write bit[n] & length = 1 to regs */ 552 /* write bit[n] & length = 1 to regs */
553 outpw(PLC(np,PL_VECTOR_LEN),len-1) ; /* len=nr-1 */ 553 outpw(PLC(np,PL_VECTOR_LEN),len-1) ; /* len=nr-1 */
@@ -562,7 +562,7 @@ static int plc_send_bits(struct s_smc *smc, struct s_phy *phy, int len)
562 printf("SIGNALING bit %d .. %d\n",phy->bitn,phy->bitn+len-1) ; 562 printf("SIGNALING bit %d .. %d\n",phy->bitn,phy->bitn+len-1) ;
563#endif 563#endif
564#endif 564#endif
565 return(0) ; 565 return 0;
566} 566}
567 567
568/* 568/*
@@ -1590,12 +1590,12 @@ int pcm_status_twisted(struct s_smc *smc)
1590{ 1590{
1591 int twist = 0 ; 1591 int twist = 0 ;
1592 if (smc->s.sas != SMT_DAS) 1592 if (smc->s.sas != SMT_DAS)
1593 return(0) ; 1593 return 0;
1594 if (smc->y[PA].twisted && (smc->y[PA].mib->fddiPORTPCMState == PC8_ACTIVE)) 1594 if (smc->y[PA].twisted && (smc->y[PA].mib->fddiPORTPCMState == PC8_ACTIVE))
1595 twist |= 1 ; 1595 twist |= 1 ;
1596 if (smc->y[PB].twisted && (smc->y[PB].mib->fddiPORTPCMState == PC8_ACTIVE)) 1596 if (smc->y[PB].twisted && (smc->y[PB].mib->fddiPORTPCMState == PC8_ACTIVE))
1597 twist |= 2 ; 1597 twist |= 2 ;
1598 return(twist) ; 1598 return twist;
1599} 1599}
1600 1600
1601/* 1601/*
@@ -1636,9 +1636,9 @@ int pcm_rooted_station(struct s_smc *smc)
1636 for (n = 0 ; n < NUMPHYS ; n++) { 1636 for (n = 0 ; n < NUMPHYS ; n++) {
1637 if (smc->y[n].mib->fddiPORTPCMState == PC8_ACTIVE && 1637 if (smc->y[n].mib->fddiPORTPCMState == PC8_ACTIVE &&
1638 smc->y[n].mib->fddiPORTNeighborType == TM) 1638 smc->y[n].mib->fddiPORTNeighborType == TM)
1639 return(0) ; 1639 return 0;
1640 } 1640 }
1641 return(1) ; 1641 return 1;
1642} 1642}
1643 1643
1644/* 1644/*
@@ -1680,7 +1680,7 @@ void plc_irq(struct s_smc *smc, int np, unsigned int cmd)
1680 * Prevent counter from being wrapped after 1680 * Prevent counter from being wrapped after
1681 * hanging years in that interrupt. 1681 * hanging years in that interrupt.
1682 */ 1682 */
1683 plc->ebuf_cont++ ; /* Ebuf continous error */ 1683 plc->ebuf_cont++ ; /* Ebuf continuous error */
1684 } 1684 }
1685 1685
1686#ifdef SUPERNET_3 1686#ifdef SUPERNET_3
@@ -1717,8 +1717,8 @@ void plc_irq(struct s_smc *smc, int np, unsigned int cmd)
1717 } 1717 }
1718#endif /* SUPERNET_3 */ 1718#endif /* SUPERNET_3 */
1719 } else { 1719 } else {
1720 /* Reset the continous error variable */ 1720 /* Reset the continuous error variable */
1721 plc->ebuf_cont = 0 ; /* reset Ebuf continous error */ 1721 plc->ebuf_cont = 0 ; /* reset Ebuf continuous error */
1722 } 1722 }
1723 if (cmd & PL_PHYINV) { /* physical layer invalid signal */ 1723 if (cmd & PL_PHYINV) { /* physical layer invalid signal */
1724 plc->phyinv++ ; 1724 plc->phyinv++ ;
@@ -1915,7 +1915,7 @@ int get_pcm_state(struct s_smc *smc, int np)
1915 case PL_PC9 : pcs = PC_MAINT ; break ; 1915 case PL_PC9 : pcs = PC_MAINT ; break ;
1916 default : pcs = PC_DISABLE ; break ; 1916 default : pcs = PC_DISABLE ; break ;
1917 } 1917 }
1918 return(pcs) ; 1918 return pcs;
1919} 1919}
1920 1920
1921char *get_linestate(struct s_smc *smc, int np) 1921char *get_linestate(struct s_smc *smc, int np)
@@ -1937,7 +1937,7 @@ char *get_linestate(struct s_smc *smc, int np)
1937 default: ls = "unknown" ; break ; 1937 default: ls = "unknown" ; break ;
1938#endif 1938#endif
1939 } 1939 }
1940 return(ls) ; 1940 return ls;
1941} 1941}
1942 1942
1943char *get_pcmstate(struct s_smc *smc, int np) 1943char *get_pcmstate(struct s_smc *smc, int np)
@@ -1959,7 +1959,7 @@ char *get_pcmstate(struct s_smc *smc, int np)
1959 case PL_PC9 : pcs = "MAINT" ; break ; 1959 case PL_PC9 : pcs = "MAINT" ; break ;
1960 default : pcs = "UNKNOWN" ; break ; 1960 default : pcs = "UNKNOWN" ; break ;
1961 } 1961 }
1962 return(pcs) ; 1962 return pcs;
1963} 1963}
1964 1964
1965void list_phy(struct s_smc *smc) 1965void list_phy(struct s_smc *smc)
diff --git a/drivers/net/skfp/pmf.c b/drivers/net/skfp/pmf.c
index a320fdb3727d..9ac4665d7411 100644
--- a/drivers/net/skfp/pmf.c
+++ b/drivers/net/skfp/pmf.c
@@ -328,7 +328,7 @@ static SMbuf *smt_build_pmf_response(struct s_smc *smc, struct smt_header *req,
328 * build SMT header 328 * build SMT header
329 */ 329 */
330 if (!(mb = smt_get_mbuf(smc))) 330 if (!(mb = smt_get_mbuf(smc)))
331 return(mb) ; 331 return mb;
332 332
333 smt = smtod(mb, struct smt_header *) ; 333 smt = smtod(mb, struct smt_header *) ;
334 smt->smt_dest = req->smt_source ; /* DA == source of request */ 334 smt->smt_dest = req->smt_source ; /* DA == source of request */
@@ -493,7 +493,7 @@ static SMbuf *smt_build_pmf_response(struct s_smc *smc, struct smt_header *req,
493 smt_add_para(smc,&set_pcon,(u_short) SMT_P1035,0,0) ; 493 smt_add_para(smc,&set_pcon,(u_short) SMT_P1035,0,0) ;
494 smt_add_para(smc,&set_pcon,(u_short) SMT_P1036,0,0) ; 494 smt_add_para(smc,&set_pcon,(u_short) SMT_P1036,0,0) ;
495 } 495 }
496 return(mb) ; 496 return mb;
497} 497}
498 498
499static int smt_authorize(struct s_smc *smc, struct smt_header *sm) 499static int smt_authorize(struct s_smc *smc, struct smt_header *sm)
@@ -511,7 +511,7 @@ static int smt_authorize(struct s_smc *smc, struct smt_header *sm)
511 if (i != 8) { 511 if (i != 8) {
512 if (memcmp((char *) &sm->smt_sid, 512 if (memcmp((char *) &sm->smt_sid,
513 (char *) &smc->mib.fddiPRPMFStation,8)) 513 (char *) &smc->mib.fddiPRPMFStation,8))
514 return(1) ; 514 return 1;
515 } 515 }
516 /* 516 /*
517 * check authoriziation parameter if passwd not zero 517 * check authoriziation parameter if passwd not zero
@@ -522,13 +522,13 @@ static int smt_authorize(struct s_smc *smc, struct smt_header *sm)
522 if (i != 8) { 522 if (i != 8) {
523 pa = (struct smt_para *) sm_to_para(smc,sm,SMT_P_AUTHOR) ; 523 pa = (struct smt_para *) sm_to_para(smc,sm,SMT_P_AUTHOR) ;
524 if (!pa) 524 if (!pa)
525 return(1) ; 525 return 1;
526 if (pa->p_len != 8) 526 if (pa->p_len != 8)
527 return(1) ; 527 return 1;
528 if (memcmp((char *)(pa+1),(char *)smc->mib.fddiPRPMFPasswd,8)) 528 if (memcmp((char *)(pa+1),(char *)smc->mib.fddiPRPMFPasswd,8))
529 return(1) ; 529 return 1;
530 } 530 }
531 return(0) ; 531 return 0;
532} 532}
533 533
534static int smt_check_set_count(struct s_smc *smc, struct smt_header *sm) 534static int smt_check_set_count(struct s_smc *smc, struct smt_header *sm)
@@ -542,9 +542,9 @@ static int smt_check_set_count(struct s_smc *smc, struct smt_header *sm)
542 if ((smc->mib.fddiSMTSetCount.count != sc->count) || 542 if ((smc->mib.fddiSMTSetCount.count != sc->count) ||
543 memcmp((char *) smc->mib.fddiSMTSetCount.timestamp, 543 memcmp((char *) smc->mib.fddiSMTSetCount.timestamp,
544 (char *)sc->timestamp,8)) 544 (char *)sc->timestamp,8))
545 return(1) ; 545 return 1;
546 } 546 }
547 return(0) ; 547 return 0;
548} 548}
549 549
550void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para, 550void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para,
@@ -1109,7 +1109,7 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
1109 break ; 1109 break ;
1110 case 0x2000 : 1110 case 0x2000 :
1111 if (mac < 0 || mac >= NUMMACS) { 1111 if (mac < 0 || mac >= NUMMACS) {
1112 return(SMT_RDF_NOPARAM) ; 1112 return SMT_RDF_NOPARAM;
1113 } 1113 }
1114 mib_m = &smc->mib.m[mac] ; 1114 mib_m = &smc->mib.m[mac] ;
1115 mib_addr = (char *) mib_m ; 1115 mib_addr = (char *) mib_m ;
@@ -1118,7 +1118,7 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
1118 break ; 1118 break ;
1119 case 0x3000 : 1119 case 0x3000 :
1120 if (path < 0 || path >= NUMPATHS) { 1120 if (path < 0 || path >= NUMPATHS) {
1121 return(SMT_RDF_NOPARAM) ; 1121 return SMT_RDF_NOPARAM;
1122 } 1122 }
1123 mib_a = &smc->mib.a[path] ; 1123 mib_a = &smc->mib.a[path] ;
1124 mib_addr = (char *) mib_a ; 1124 mib_addr = (char *) mib_a ;
@@ -1127,7 +1127,7 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
1127 break ; 1127 break ;
1128 case 0x4000 : 1128 case 0x4000 :
1129 if (port < 0 || port >= smt_mib_phys(smc)) { 1129 if (port < 0 || port >= smt_mib_phys(smc)) {
1130 return(SMT_RDF_NOPARAM) ; 1130 return SMT_RDF_NOPARAM;
1131 } 1131 }
1132 mib_p = &smc->mib.p[port_to_mib(smc,port)] ; 1132 mib_p = &smc->mib.p[port_to_mib(smc,port)] ;
1133 mib_addr = (char *) mib_p ; 1133 mib_addr = (char *) mib_p ;
@@ -1151,22 +1151,20 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
1151 case SMT_P10F9 : 1151 case SMT_P10F9 :
1152#endif 1152#endif
1153 case SMT_P20F1 : 1153 case SMT_P20F1 :
1154 if (!local) { 1154 if (!local)
1155 return(SMT_RDF_NOPARAM) ; 1155 return SMT_RDF_NOPARAM;
1156 }
1157 break ; 1156 break ;
1158 } 1157 }
1159 pt = smt_get_ptab(pa->p_type) ; 1158 pt = smt_get_ptab(pa->p_type) ;
1160 if (!pt) { 1159 if (!pt)
1161 return( (pa->p_type & 0xff00) ? SMT_RDF_NOPARAM : 1160 return (pa->p_type & 0xff00) ? SMT_RDF_NOPARAM :
1162 SMT_RDF_ILLEGAL ) ; 1161 SMT_RDF_ILLEGAL;
1163 }
1164 switch (pt->p_access) { 1162 switch (pt->p_access) {
1165 case AC_GR : 1163 case AC_GR :
1166 case AC_S : 1164 case AC_S :
1167 break ; 1165 break ;
1168 default : 1166 default :
1169 return(SMT_RDF_ILLEGAL) ; 1167 return SMT_RDF_ILLEGAL;
1170 } 1168 }
1171 to = mib_addr + pt->p_offset ; 1169 to = mib_addr + pt->p_offset ;
1172 swap = pt->p_swap ; /* pointer to swap string */ 1170 swap = pt->p_swap ; /* pointer to swap string */
@@ -1292,7 +1290,7 @@ static int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index,
1292 break ; 1290 break ;
1293 default : 1291 default :
1294 SMT_PANIC(smc,SMT_E0120, SMT_E0120_MSG) ; 1292 SMT_PANIC(smc,SMT_E0120, SMT_E0120_MSG) ;
1295 return(SMT_RDF_ILLEGAL) ; 1293 return SMT_RDF_ILLEGAL;
1296 } 1294 }
1297 } 1295 }
1298 /* 1296 /*
@@ -1501,15 +1499,15 @@ change_mac_para:
1501 default : 1499 default :
1502 break ; 1500 break ;
1503 } 1501 }
1504 return(0) ; 1502 return 0;
1505 1503
1506val_error: 1504val_error:
1507 /* parameter value in frame is out of range */ 1505 /* parameter value in frame is out of range */
1508 return(SMT_RDF_RANGE) ; 1506 return SMT_RDF_RANGE;
1509 1507
1510len_error: 1508len_error:
1511 /* parameter value in frame is too short */ 1509 /* parameter value in frame is too short */
1512 return(SMT_RDF_LENGTH) ; 1510 return SMT_RDF_LENGTH;
1513 1511
1514#if 0 1512#if 0
1515no_author_error: 1513no_author_error:
@@ -1518,7 +1516,7 @@ no_author_error:
1518 * because SBA denied is not a valid return code in the 1516 * because SBA denied is not a valid return code in the
1519 * PMF protocol. 1517 * PMF protocol.
1520 */ 1518 */
1521 return(SMT_RDF_AUTHOR) ; 1519 return SMT_RDF_AUTHOR;
1522#endif 1520#endif
1523} 1521}
1524 1522
@@ -1527,7 +1525,7 @@ static const struct s_p_tab *smt_get_ptab(u_short para)
1527 const struct s_p_tab *pt ; 1525 const struct s_p_tab *pt ;
1528 for (pt = p_tab ; pt->p_num && pt->p_num != para ; pt++) 1526 for (pt = p_tab ; pt->p_num && pt->p_num != para ; pt++)
1529 ; 1527 ;
1530 return(pt->p_num ? pt : NULL) ; 1528 return pt->p_num ? pt : NULL;
1531} 1529}
1532 1530
1533static int smt_mib_phys(struct s_smc *smc) 1531static int smt_mib_phys(struct s_smc *smc)
@@ -1535,11 +1533,11 @@ static int smt_mib_phys(struct s_smc *smc)
1535#ifdef CONCENTRATOR 1533#ifdef CONCENTRATOR
1536 SK_UNUSED(smc) ; 1534 SK_UNUSED(smc) ;
1537 1535
1538 return(NUMPHYS) ; 1536 return NUMPHYS;
1539#else 1537#else
1540 if (smc->s.sas == SMT_SAS) 1538 if (smc->s.sas == SMT_SAS)
1541 return(1) ; 1539 return 1;
1542 return(NUMPHYS) ; 1540 return NUMPHYS;
1543#endif 1541#endif
1544} 1542}
1545 1543
@@ -1548,11 +1546,11 @@ static int port_to_mib(struct s_smc *smc, int p)
1548#ifdef CONCENTRATOR 1546#ifdef CONCENTRATOR
1549 SK_UNUSED(smc) ; 1547 SK_UNUSED(smc) ;
1550 1548
1551 return(p) ; 1549 return p;
1552#else 1550#else
1553 if (smc->s.sas == SMT_SAS) 1551 if (smc->s.sas == SMT_SAS)
1554 return(PS) ; 1552 return PS;
1555 return(p) ; 1553 return p;
1556#endif 1554#endif
1557} 1555}
1558 1556
diff --git a/drivers/net/skfp/queue.c b/drivers/net/skfp/queue.c
index 09adb3d68b7c..c1a0df455a59 100644
--- a/drivers/net/skfp/queue.c
+++ b/drivers/net/skfp/queue.c
@@ -128,7 +128,7 @@ u_short smt_online(struct s_smc *smc, int on)
128{ 128{
129 queue_event(smc,EVENT_ECM,on ? EC_CONNECT : EC_DISCONNECT) ; 129 queue_event(smc,EVENT_ECM,on ? EC_CONNECT : EC_DISCONNECT) ;
130 ev_dispatcher(smc) ; 130 ev_dispatcher(smc) ;
131 return(smc->mib.fddiSMTCF_State) ; 131 return smc->mib.fddiSMTCF_State;
132} 132}
133 133
134/* 134/*
diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c
index 31b2dabf094c..16c62659cdd9 100644
--- a/drivers/net/skfp/skfddi.c
+++ b/drivers/net/skfp/skfddi.c
@@ -33,7 +33,7 @@
33 * The driver architecture is based on the DEC FDDI driver by 33 * The driver architecture is based on the DEC FDDI driver by
34 * Lawrence V. Stefani and several ethernet drivers. 34 * Lawrence V. Stefani and several ethernet drivers.
35 * I also used an existing Windows NT miniport driver. 35 * I also used an existing Windows NT miniport driver.
36 * All hardware dependent fuctions are handled by the SysKonnect 36 * All hardware dependent functions are handled by the SysKonnect
37 * Hardware Module. 37 * Hardware Module.
38 * The only headerfiles that are directly related to this source 38 * The only headerfiles that are directly related to this source
39 * are skfddi.c, h/types.h, h/osdef1st.h, h/targetos.h. 39 * are skfddi.c, h/types.h, h/osdef1st.h, h/targetos.h.
@@ -209,7 +209,7 @@ static int skfp_init_one(struct pci_dev *pdev,
209 void __iomem *mem; 209 void __iomem *mem;
210 int err; 210 int err;
211 211
212 pr_debug(KERN_INFO "entering skfp_init_one\n"); 212 pr_debug("entering skfp_init_one\n");
213 213
214 if (num_boards == 0) 214 if (num_boards == 0)
215 printk("%s\n", boot_msg); 215 printk("%s\n", boot_msg);
@@ -385,7 +385,7 @@ static int skfp_driver_init(struct net_device *dev)
385 skfddi_priv *bp = &smc->os; 385 skfddi_priv *bp = &smc->os;
386 int err = -EIO; 386 int err = -EIO;
387 387
388 pr_debug(KERN_INFO "entering skfp_driver_init\n"); 388 pr_debug("entering skfp_driver_init\n");
389 389
390 // set the io address in private structures 390 // set the io address in private structures
391 bp->base_addr = dev->base_addr; 391 bp->base_addr = dev->base_addr;
@@ -405,14 +405,14 @@ static int skfp_driver_init(struct net_device *dev)
405 405
406 // Determine the required size of the 'shared' memory area. 406 // Determine the required size of the 'shared' memory area.
407 bp->SharedMemSize = mac_drv_check_space(); 407 bp->SharedMemSize = mac_drv_check_space();
408 pr_debug(KERN_INFO "Memory for HWM: %ld\n", bp->SharedMemSize); 408 pr_debug("Memory for HWM: %ld\n", bp->SharedMemSize);
409 if (bp->SharedMemSize > 0) { 409 if (bp->SharedMemSize > 0) {
410 bp->SharedMemSize += 16; // for descriptor alignment 410 bp->SharedMemSize += 16; // for descriptor alignment
411 411
412 bp->SharedMemAddr = pci_alloc_consistent(&bp->pdev, 412 bp->SharedMemAddr = pci_alloc_consistent(&bp->pdev,
413 bp->SharedMemSize, 413 bp->SharedMemSize,
414 &bp->SharedMemDMA); 414 &bp->SharedMemDMA);
415 if (!bp->SharedMemSize) { 415 if (!bp->SharedMemAddr) {
416 printk("could not allocate mem for "); 416 printk("could not allocate mem for ");
417 printk("hardware module: %ld byte\n", 417 printk("hardware module: %ld byte\n",
418 bp->SharedMemSize); 418 bp->SharedMemSize);
@@ -429,18 +429,18 @@ static int skfp_driver_init(struct net_device *dev)
429 429
430 card_stop(smc); // Reset adapter. 430 card_stop(smc); // Reset adapter.
431 431
432 pr_debug(KERN_INFO "mac_drv_init()..\n"); 432 pr_debug("mac_drv_init()..\n");
433 if (mac_drv_init(smc) != 0) { 433 if (mac_drv_init(smc) != 0) {
434 pr_debug(KERN_INFO "mac_drv_init() failed.\n"); 434 pr_debug("mac_drv_init() failed\n");
435 goto fail; 435 goto fail;
436 } 436 }
437 read_address(smc, NULL); 437 read_address(smc, NULL);
438 pr_debug(KERN_INFO "HW-Addr: %pMF\n", smc->hw.fddi_canon_addr.a); 438 pr_debug("HW-Addr: %pMF\n", smc->hw.fddi_canon_addr.a);
439 memcpy(dev->dev_addr, smc->hw.fddi_canon_addr.a, 6); 439 memcpy(dev->dev_addr, smc->hw.fddi_canon_addr.a, 6);
440 440
441 smt_reset_defaults(smc, 0); 441 smt_reset_defaults(smc, 0);
442 442
443 return (0); 443 return 0;
444 444
445fail: 445fail:
446 if (bp->SharedMemAddr) { 446 if (bp->SharedMemAddr) {
@@ -485,7 +485,7 @@ static int skfp_open(struct net_device *dev)
485 struct s_smc *smc = netdev_priv(dev); 485 struct s_smc *smc = netdev_priv(dev);
486 int err; 486 int err;
487 487
488 pr_debug(KERN_INFO "entering skfp_open\n"); 488 pr_debug("entering skfp_open\n");
489 /* Register IRQ - support shared interrupts by passing device ptr */ 489 /* Register IRQ - support shared interrupts by passing device ptr */
490 err = request_irq(dev->irq, skfp_interrupt, IRQF_SHARED, 490 err = request_irq(dev->irq, skfp_interrupt, IRQF_SHARED,
491 dev->name, dev); 491 dev->name, dev);
@@ -516,7 +516,7 @@ static int skfp_open(struct net_device *dev)
516 mac_drv_rx_mode(smc, RX_DISABLE_PROMISC); 516 mac_drv_rx_mode(smc, RX_DISABLE_PROMISC);
517 517
518 netif_start_queue(dev); 518 netif_start_queue(dev);
519 return (0); 519 return 0;
520} // skfp_open 520} // skfp_open
521 521
522 522
@@ -565,7 +565,7 @@ static int skfp_close(struct net_device *dev)
565 skb_queue_purge(&bp->SendSkbQueue); 565 skb_queue_purge(&bp->SendSkbQueue);
566 bp->QueueSkb = MAX_TX_QUEUE_LEN; 566 bp->QueueSkb = MAX_TX_QUEUE_LEN;
567 567
568 return (0); 568 return 0;
569} // skfp_close 569} // skfp_close
570 570
571 571
@@ -794,7 +794,7 @@ static struct net_device_stats *skfp_ctl_get_stats(struct net_device *dev)
794 bp->stats.port_lem_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[1].ls; 794 bp->stats.port_lem_cts[1] = bp->cmd_rsp_virt->cntrs_get.cntrs.link_errors[1].ls;
795 795
796#endif 796#endif
797 return ((struct net_device_stats *) &bp->os.MacStat); 797 return (struct net_device_stats *)&bp->os.MacStat;
798} // ctl_get_stat 798} // ctl_get_stat
799 799
800 800
@@ -856,12 +856,12 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev)
856 /* Enable promiscuous mode, if necessary */ 856 /* Enable promiscuous mode, if necessary */
857 if (dev->flags & IFF_PROMISC) { 857 if (dev->flags & IFF_PROMISC) {
858 mac_drv_rx_mode(smc, RX_ENABLE_PROMISC); 858 mac_drv_rx_mode(smc, RX_ENABLE_PROMISC);
859 pr_debug(KERN_INFO "PROMISCUOUS MODE ENABLED\n"); 859 pr_debug("PROMISCUOUS MODE ENABLED\n");
860 } 860 }
861 /* Else, update multicast address table */ 861 /* Else, update multicast address table */
862 else { 862 else {
863 mac_drv_rx_mode(smc, RX_DISABLE_PROMISC); 863 mac_drv_rx_mode(smc, RX_DISABLE_PROMISC);
864 pr_debug(KERN_INFO "PROMISCUOUS MODE DISABLED\n"); 864 pr_debug("PROMISCUOUS MODE DISABLED\n");
865 865
866 // Reset all MC addresses 866 // Reset all MC addresses
867 mac_clear_multicast(smc); 867 mac_clear_multicast(smc);
@@ -869,7 +869,7 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev)
869 869
870 if (dev->flags & IFF_ALLMULTI) { 870 if (dev->flags & IFF_ALLMULTI) {
871 mac_drv_rx_mode(smc, RX_ENABLE_ALLMULTI); 871 mac_drv_rx_mode(smc, RX_ENABLE_ALLMULTI);
872 pr_debug(KERN_INFO "ENABLE ALL MC ADDRESSES\n"); 872 pr_debug("ENABLE ALL MC ADDRESSES\n");
873 } else if (!netdev_mc_empty(dev)) { 873 } else if (!netdev_mc_empty(dev)) {
874 if (netdev_mc_count(dev) <= FPMAX_MULTICAST) { 874 if (netdev_mc_count(dev) <= FPMAX_MULTICAST) {
875 /* use exact filtering */ 875 /* use exact filtering */
@@ -880,18 +880,18 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev)
880 (struct fddi_addr *)ha->addr, 880 (struct fddi_addr *)ha->addr,
881 1); 881 1);
882 882
883 pr_debug(KERN_INFO "ENABLE MC ADDRESS: %pMF\n", 883 pr_debug("ENABLE MC ADDRESS: %pMF\n",
884 ha->addr); 884 ha->addr);
885 } 885 }
886 886
887 } else { // more MC addresses than HW supports 887 } else { // more MC addresses than HW supports
888 888
889 mac_drv_rx_mode(smc, RX_ENABLE_ALLMULTI); 889 mac_drv_rx_mode(smc, RX_ENABLE_ALLMULTI);
890 pr_debug(KERN_INFO "ENABLE ALL MC ADDRESSES\n"); 890 pr_debug("ENABLE ALL MC ADDRESSES\n");
891 } 891 }
892 } else { // no MC addresses 892 } else { // no MC addresses
893 893
894 pr_debug(KERN_INFO "DISABLE ALL MC ADDRESSES\n"); 894 pr_debug("DISABLE ALL MC ADDRESSES\n");
895 } 895 }
896 896
897 /* Update adapter filters */ 897 /* Update adapter filters */
@@ -932,7 +932,7 @@ static int skfp_ctl_set_mac_address(struct net_device *dev, void *addr)
932 ResetAdapter(smc); 932 ResetAdapter(smc);
933 spin_unlock_irqrestore(&bp->DriverLock, Flags); 933 spin_unlock_irqrestore(&bp->DriverLock, Flags);
934 934
935 return (0); /* always return zero */ 935 return 0; /* always return zero */
936} // skfp_ctl_set_mac_address 936} // skfp_ctl_set_mac_address
937 937
938 938
@@ -1045,7 +1045,7 @@ static netdev_tx_t skfp_send_pkt(struct sk_buff *skb,
1045 struct s_smc *smc = netdev_priv(dev); 1045 struct s_smc *smc = netdev_priv(dev);
1046 skfddi_priv *bp = &smc->os; 1046 skfddi_priv *bp = &smc->os;
1047 1047
1048 pr_debug(KERN_INFO "skfp_send_pkt\n"); 1048 pr_debug("skfp_send_pkt\n");
1049 1049
1050 /* 1050 /*
1051 * Verify that incoming transmit request is OK 1051 * Verify that incoming transmit request is OK
@@ -1114,13 +1114,13 @@ static void send_queued_packets(struct s_smc *smc)
1114 1114
1115 int frame_status; // HWM tx frame status. 1115 int frame_status; // HWM tx frame status.
1116 1116
1117 pr_debug(KERN_INFO "send queued packets\n"); 1117 pr_debug("send queued packets\n");
1118 for (;;) { 1118 for (;;) {
1119 // send first buffer from queue 1119 // send first buffer from queue
1120 skb = skb_dequeue(&bp->SendSkbQueue); 1120 skb = skb_dequeue(&bp->SendSkbQueue);
1121 1121
1122 if (!skb) { 1122 if (!skb) {
1123 pr_debug(KERN_INFO "queue empty\n"); 1123 pr_debug("queue empty\n");
1124 return; 1124 return;
1125 } // queue empty ! 1125 } // queue empty !
1126 1126
@@ -1232,7 +1232,7 @@ static void CheckSourceAddress(unsigned char *frame, unsigned char *hw_addr)
1232static void ResetAdapter(struct s_smc *smc) 1232static void ResetAdapter(struct s_smc *smc)
1233{ 1233{
1234 1234
1235 pr_debug(KERN_INFO "[fddi: ResetAdapter]\n"); 1235 pr_debug("[fddi: ResetAdapter]\n");
1236 1236
1237 // Stop the adapter. 1237 // Stop the adapter.
1238 1238
@@ -1278,7 +1278,7 @@ void llc_restart_tx(struct s_smc *smc)
1278{ 1278{
1279 skfddi_priv *bp = &smc->os; 1279 skfddi_priv *bp = &smc->os;
1280 1280
1281 pr_debug(KERN_INFO "[llc_restart_tx]\n"); 1281 pr_debug("[llc_restart_tx]\n");
1282 1282
1283 // Try to send queued packets 1283 // Try to send queued packets
1284 spin_unlock(&bp->DriverLock); 1284 spin_unlock(&bp->DriverLock);
@@ -1308,21 +1308,21 @@ void *mac_drv_get_space(struct s_smc *smc, unsigned int size)
1308{ 1308{
1309 void *virt; 1309 void *virt;
1310 1310
1311 pr_debug(KERN_INFO "mac_drv_get_space (%d bytes), ", size); 1311 pr_debug("mac_drv_get_space (%d bytes), ", size);
1312 virt = (void *) (smc->os.SharedMemAddr + smc->os.SharedMemHeap); 1312 virt = (void *) (smc->os.SharedMemAddr + smc->os.SharedMemHeap);
1313 1313
1314 if ((smc->os.SharedMemHeap + size) > smc->os.SharedMemSize) { 1314 if ((smc->os.SharedMemHeap + size) > smc->os.SharedMemSize) {
1315 printk("Unexpected SMT memory size requested: %d\n", size); 1315 printk("Unexpected SMT memory size requested: %d\n", size);
1316 return (NULL); 1316 return NULL;
1317 } 1317 }
1318 smc->os.SharedMemHeap += size; // Move heap pointer. 1318 smc->os.SharedMemHeap += size; // Move heap pointer.
1319 1319
1320 pr_debug(KERN_INFO "mac_drv_get_space end\n"); 1320 pr_debug("mac_drv_get_space end\n");
1321 pr_debug(KERN_INFO "virt addr: %lx\n", (ulong) virt); 1321 pr_debug("virt addr: %lx\n", (ulong) virt);
1322 pr_debug(KERN_INFO "bus addr: %lx\n", (ulong) 1322 pr_debug("bus addr: %lx\n", (ulong)
1323 (smc->os.SharedMemDMA + 1323 (smc->os.SharedMemDMA +
1324 ((char *) virt - (char *)smc->os.SharedMemAddr))); 1324 ((char *) virt - (char *)smc->os.SharedMemAddr)));
1325 return (virt); 1325 return virt;
1326} // mac_drv_get_space 1326} // mac_drv_get_space
1327 1327
1328 1328
@@ -1349,7 +1349,7 @@ void *mac_drv_get_desc_mem(struct s_smc *smc, unsigned int size)
1349 1349
1350 char *virt; 1350 char *virt;
1351 1351
1352 pr_debug(KERN_INFO "mac_drv_get_desc_mem\n"); 1352 pr_debug("mac_drv_get_desc_mem\n");
1353 1353
1354 // Descriptor memory must be aligned on 16-byte boundary. 1354 // Descriptor memory must be aligned on 16-byte boundary.
1355 1355
@@ -1363,9 +1363,9 @@ void *mac_drv_get_desc_mem(struct s_smc *smc, unsigned int size)
1363 1363
1364 if (!mac_drv_get_space(smc, size)) { 1364 if (!mac_drv_get_space(smc, size)) {
1365 printk("fddi: Unable to align descriptor memory.\n"); 1365 printk("fddi: Unable to align descriptor memory.\n");
1366 return (NULL); 1366 return NULL;
1367 } 1367 }
1368 return (virt + size); 1368 return virt + size;
1369} // mac_drv_get_desc_mem 1369} // mac_drv_get_desc_mem
1370 1370
1371 1371
@@ -1384,8 +1384,8 @@ void *mac_drv_get_desc_mem(struct s_smc *smc, unsigned int size)
1384 ************************/ 1384 ************************/
1385unsigned long mac_drv_virt2phys(struct s_smc *smc, void *virt) 1385unsigned long mac_drv_virt2phys(struct s_smc *smc, void *virt)
1386{ 1386{
1387 return (smc->os.SharedMemDMA + 1387 return smc->os.SharedMemDMA +
1388 ((char *) virt - (char *)smc->os.SharedMemAddr)); 1388 ((char *) virt - (char *)smc->os.SharedMemAddr);
1389} // mac_drv_virt2phys 1389} // mac_drv_virt2phys
1390 1390
1391 1391
@@ -1419,8 +1419,8 @@ unsigned long mac_drv_virt2phys(struct s_smc *smc, void *virt)
1419 ************************/ 1419 ************************/
1420u_long dma_master(struct s_smc * smc, void *virt, int len, int flag) 1420u_long dma_master(struct s_smc * smc, void *virt, int len, int flag)
1421{ 1421{
1422 return (smc->os.SharedMemDMA + 1422 return smc->os.SharedMemDMA +
1423 ((char *) virt - (char *)smc->os.SharedMemAddr)); 1423 ((char *) virt - (char *)smc->os.SharedMemAddr);
1424} // dma_master 1424} // dma_master
1425 1425
1426 1426
@@ -1493,7 +1493,7 @@ void mac_drv_tx_complete(struct s_smc *smc, volatile struct s_smt_fp_txd *txd)
1493{ 1493{
1494 struct sk_buff *skb; 1494 struct sk_buff *skb;
1495 1495
1496 pr_debug(KERN_INFO "entering mac_drv_tx_complete\n"); 1496 pr_debug("entering mac_drv_tx_complete\n");
1497 // Check if this TxD points to a skb 1497 // Check if this TxD points to a skb
1498 1498
1499 if (!(skb = txd->txd_os.skb)) { 1499 if (!(skb = txd->txd_os.skb)) {
@@ -1513,7 +1513,7 @@ void mac_drv_tx_complete(struct s_smc *smc, volatile struct s_smt_fp_txd *txd)
1513 // free the skb 1513 // free the skb
1514 dev_kfree_skb_irq(skb); 1514 dev_kfree_skb_irq(skb);
1515 1515
1516 pr_debug(KERN_INFO "leaving mac_drv_tx_complete\n"); 1516 pr_debug("leaving mac_drv_tx_complete\n");
1517} // mac_drv_tx_complete 1517} // mac_drv_tx_complete
1518 1518
1519 1519
@@ -1580,7 +1580,7 @@ void mac_drv_rx_complete(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd,
1580 unsigned short ri; 1580 unsigned short ri;
1581 u_int RifLength; 1581 u_int RifLength;
1582 1582
1583 pr_debug(KERN_INFO "entering mac_drv_rx_complete (len=%d)\n", len); 1583 pr_debug("entering mac_drv_rx_complete (len=%d)\n", len);
1584 if (frag_count != 1) { // This is not allowed to happen. 1584 if (frag_count != 1) { // This is not allowed to happen.
1585 1585
1586 printk("fddi: Multi-fragment receive!\n"); 1586 printk("fddi: Multi-fragment receive!\n");
@@ -1589,7 +1589,7 @@ void mac_drv_rx_complete(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd,
1589 } 1589 }
1590 skb = rxd->rxd_os.skb; 1590 skb = rxd->rxd_os.skb;
1591 if (!skb) { 1591 if (!skb) {
1592 pr_debug(KERN_INFO "No skb in rxd\n"); 1592 pr_debug("No skb in rxd\n");
1593 smc->os.MacStat.gen.rx_errors++; 1593 smc->os.MacStat.gen.rx_errors++;
1594 goto RequeueRxd; 1594 goto RequeueRxd;
1595 } 1595 }
@@ -1619,7 +1619,7 @@ void mac_drv_rx_complete(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd,
1619 else { 1619 else {
1620 int n; 1620 int n;
1621// goos: RIF removal has still to be tested 1621// goos: RIF removal has still to be tested
1622 pr_debug(KERN_INFO "RIF found\n"); 1622 pr_debug("RIF found\n");
1623 // Get RIF length from Routing Control (RC) field. 1623 // Get RIF length from Routing Control (RC) field.
1624 cp = virt + FDDI_MAC_HDR_LEN; // Point behind MAC header. 1624 cp = virt + FDDI_MAC_HDR_LEN; // Point behind MAC header.
1625 1625
@@ -1664,7 +1664,7 @@ void mac_drv_rx_complete(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd,
1664 return; 1664 return;
1665 1665
1666 RequeueRxd: 1666 RequeueRxd:
1667 pr_debug(KERN_INFO "Rx: re-queue RXD.\n"); 1667 pr_debug("Rx: re-queue RXD.\n");
1668 mac_drv_requeue_rxd(smc, rxd, frag_count); 1668 mac_drv_requeue_rxd(smc, rxd, frag_count);
1669 smc->os.MacStat.gen.rx_errors++; // Count receive packets 1669 smc->os.MacStat.gen.rx_errors++; // Count receive packets
1670 // not indicated. 1670 // not indicated.
@@ -1775,7 +1775,7 @@ void mac_drv_fill_rxd(struct s_smc *smc)
1775 struct sk_buff *skb; 1775 struct sk_buff *skb;
1776 volatile struct s_smt_fp_rxd *rxd; 1776 volatile struct s_smt_fp_rxd *rxd;
1777 1777
1778 pr_debug(KERN_INFO "entering mac_drv_fill_rxd\n"); 1778 pr_debug("entering mac_drv_fill_rxd\n");
1779 1779
1780 // Walk through the list of free receive buffers, passing receive 1780 // Walk through the list of free receive buffers, passing receive
1781 // buffers to the HWM as long as RXDs are available. 1781 // buffers to the HWM as long as RXDs are available.
@@ -1783,7 +1783,7 @@ void mac_drv_fill_rxd(struct s_smc *smc)
1783 MaxFrameSize = smc->os.MaxFrameSize; 1783 MaxFrameSize = smc->os.MaxFrameSize;
1784 // Check if there is any RXD left. 1784 // Check if there is any RXD left.
1785 while (HWM_GET_RX_FREE(smc) > 0) { 1785 while (HWM_GET_RX_FREE(smc) > 0) {
1786 pr_debug(KERN_INFO ".\n"); 1786 pr_debug(".\n");
1787 1787
1788 rxd = HWM_GET_CURR_RXD(smc); 1788 rxd = HWM_GET_CURR_RXD(smc);
1789 skb = alloc_skb(MaxFrameSize + 3, GFP_ATOMIC); 1789 skb = alloc_skb(MaxFrameSize + 3, GFP_ATOMIC);
@@ -1814,7 +1814,7 @@ void mac_drv_fill_rxd(struct s_smc *smc)
1814 hwm_rx_frag(smc, v_addr, b_addr, MaxFrameSize, 1814 hwm_rx_frag(smc, v_addr, b_addr, MaxFrameSize,
1815 FIRST_FRAG | LAST_FRAG); 1815 FIRST_FRAG | LAST_FRAG);
1816 } 1816 }
1817 pr_debug(KERN_INFO "leaving mac_drv_fill_rxd\n"); 1817 pr_debug("leaving mac_drv_fill_rxd\n");
1818} // mac_drv_fill_rxd 1818} // mac_drv_fill_rxd
1819 1819
1820 1820
@@ -1904,12 +1904,12 @@ int mac_drv_rx_init(struct s_smc *smc, int len, int fc,
1904 pr_debug("fddi: Discard invalid local SMT frame\n"); 1904 pr_debug("fddi: Discard invalid local SMT frame\n");
1905 pr_debug(" len=%d, la_len=%d, (ULONG) look_ahead=%08lXh.\n", 1905 pr_debug(" len=%d, la_len=%d, (ULONG) look_ahead=%08lXh.\n",
1906 len, la_len, (unsigned long) look_ahead); 1906 len, la_len, (unsigned long) look_ahead);
1907 return (0); 1907 return 0;
1908 } 1908 }
1909 skb = alloc_skb(len + 3, GFP_ATOMIC); 1909 skb = alloc_skb(len + 3, GFP_ATOMIC);
1910 if (!skb) { 1910 if (!skb) {
1911 pr_debug("fddi: Local SMT: skb memory exhausted.\n"); 1911 pr_debug("fddi: Local SMT: skb memory exhausted.\n");
1912 return (0); 1912 return 0;
1913 } 1913 }
1914 skb_reserve(skb, 3); 1914 skb_reserve(skb, 3);
1915 skb_put(skb, len); 1915 skb_put(skb, len);
@@ -1919,7 +1919,7 @@ int mac_drv_rx_init(struct s_smc *smc, int len, int fc,
1919 skb->protocol = fddi_type_trans(skb, smc->os.dev); 1919 skb->protocol = fddi_type_trans(skb, smc->os.dev);
1920 netif_rx(skb); 1920 netif_rx(skb);
1921 1921
1922 return (0); 1922 return 0;
1923} // mac_drv_rx_init 1923} // mac_drv_rx_init
1924 1924
1925 1925
@@ -2034,17 +2034,17 @@ void smt_stat_counter(struct s_smc *smc, int stat)
2034{ 2034{
2035// BOOLEAN RingIsUp ; 2035// BOOLEAN RingIsUp ;
2036 2036
2037 pr_debug(KERN_INFO "smt_stat_counter\n"); 2037 pr_debug("smt_stat_counter\n");
2038 switch (stat) { 2038 switch (stat) {
2039 case 0: 2039 case 0:
2040 pr_debug(KERN_INFO "Ring operational change.\n"); 2040 pr_debug("Ring operational change.\n");
2041 break; 2041 break;
2042 case 1: 2042 case 1:
2043 pr_debug(KERN_INFO "Receive fifo overflow.\n"); 2043 pr_debug("Receive fifo overflow.\n");
2044 smc->os.MacStat.gen.rx_errors++; 2044 smc->os.MacStat.gen.rx_errors++;
2045 break; 2045 break;
2046 default: 2046 default:
2047 pr_debug(KERN_INFO "Unknown status (%d).\n", stat); 2047 pr_debug("Unknown status (%d).\n", stat);
2048 break; 2048 break;
2049 } 2049 }
2050} // smt_stat_counter 2050} // smt_stat_counter
@@ -2100,10 +2100,10 @@ void cfm_state_change(struct s_smc *smc, int c_state)
2100 s = "SC11_C_WRAP_S"; 2100 s = "SC11_C_WRAP_S";
2101 break; 2101 break;
2102 default: 2102 default:
2103 pr_debug(KERN_INFO "cfm_state_change: unknown %d\n", c_state); 2103 pr_debug("cfm_state_change: unknown %d\n", c_state);
2104 return; 2104 return;
2105 } 2105 }
2106 pr_debug(KERN_INFO "cfm_state_change: %s\n", s); 2106 pr_debug("cfm_state_change: %s\n", s);
2107#endif // DRIVERDEBUG 2107#endif // DRIVERDEBUG
2108} // cfm_state_change 2108} // cfm_state_change
2109 2109
@@ -2158,7 +2158,7 @@ void ecm_state_change(struct s_smc *smc, int e_state)
2158 s = "unknown"; 2158 s = "unknown";
2159 break; 2159 break;
2160 } 2160 }
2161 pr_debug(KERN_INFO "ecm_state_change: %s\n", s); 2161 pr_debug("ecm_state_change: %s\n", s);
2162#endif //DRIVERDEBUG 2162#endif //DRIVERDEBUG
2163} // ecm_state_change 2163} // ecm_state_change
2164 2164
@@ -2213,7 +2213,7 @@ void rmt_state_change(struct s_smc *smc, int r_state)
2213 s = "unknown"; 2213 s = "unknown";
2214 break; 2214 break;
2215 } 2215 }
2216 pr_debug(KERN_INFO "[rmt_state_change: %s]\n", s); 2216 pr_debug("[rmt_state_change: %s]\n", s);
2217#endif // DRIVERDEBUG 2217#endif // DRIVERDEBUG
2218} // rmt_state_change 2218} // rmt_state_change
2219 2219
@@ -2233,7 +2233,7 @@ void rmt_state_change(struct s_smc *smc, int r_state)
2233 ************************/ 2233 ************************/
2234void drv_reset_indication(struct s_smc *smc) 2234void drv_reset_indication(struct s_smc *smc)
2235{ 2235{
2236 pr_debug(KERN_INFO "entering drv_reset_indication\n"); 2236 pr_debug("entering drv_reset_indication\n");
2237 2237
2238 smc->os.ResetRequested = TRUE; // Set flag. 2238 smc->os.ResetRequested = TRUE; // Set flag.
2239 2239
diff --git a/drivers/net/skfp/smt.c b/drivers/net/skfp/smt.c
index 6f35bb77595f..08d94329c12f 100644
--- a/drivers/net/skfp/smt.c
+++ b/drivers/net/skfp/smt.c
@@ -127,22 +127,22 @@ static inline int is_my_addr(const struct s_smc *smc,
127 127
128static inline int is_broadcast(const struct fddi_addr *addr) 128static inline int is_broadcast(const struct fddi_addr *addr)
129{ 129{
130 return(*(u_short *)(&addr->a[0]) == 0xffff && 130 return *(u_short *)(&addr->a[0]) == 0xffff &&
131 *(u_short *)(&addr->a[2]) == 0xffff && 131 *(u_short *)(&addr->a[2]) == 0xffff &&
132 *(u_short *)(&addr->a[4]) == 0xffff ) ; 132 *(u_short *)(&addr->a[4]) == 0xffff;
133} 133}
134 134
135static inline int is_individual(const struct fddi_addr *addr) 135static inline int is_individual(const struct fddi_addr *addr)
136{ 136{
137 return(!(addr->a[0] & GROUP_ADDR)) ; 137 return !(addr->a[0] & GROUP_ADDR);
138} 138}
139 139
140static inline int is_equal(const struct fddi_addr *addr1, 140static inline int is_equal(const struct fddi_addr *addr1,
141 const struct fddi_addr *addr2) 141 const struct fddi_addr *addr2)
142{ 142{
143 return(*(u_short *)(&addr1->a[0]) == *(u_short *)(&addr2->a[0]) && 143 return *(u_short *)(&addr1->a[0]) == *(u_short *)(&addr2->a[0]) &&
144 *(u_short *)(&addr1->a[2]) == *(u_short *)(&addr2->a[2]) && 144 *(u_short *)(&addr1->a[2]) == *(u_short *)(&addr2->a[2]) &&
145 *(u_short *)(&addr1->a[4]) == *(u_short *)(&addr2->a[4]) ) ; 145 *(u_short *)(&addr1->a[4]) == *(u_short *)(&addr2->a[4]);
146} 146}
147 147
148/* 148/*
@@ -219,7 +219,7 @@ void smt_emulate_token_ct(struct s_smc *smc, int mac_index)
219 219
220 /* 220 /*
221 * Only when ring is up we will have a token count. The 221 * Only when ring is up we will have a token count. The
222 * flag is unfortunatly a single instance value. This 222 * flag is unfortunately a single instance value. This
223 * doesn't matter now, because we currently have only 223 * doesn't matter now, because we currently have only
224 * one MAC instance. 224 * one MAC instance.
225 */ 225 */
@@ -457,8 +457,8 @@ static int div_ratio(u_long upper, u_long lower)
457 else 457 else
458 upper <<= 16L ; 458 upper <<= 16L ;
459 if (!lower) 459 if (!lower)
460 return(0) ; 460 return 0;
461 return((int)(upper/lower)) ; 461 return (int)(upper/lower) ;
462} 462}
463 463
464#ifndef SLIM_SMT 464#ifndef SLIM_SMT
@@ -1111,11 +1111,11 @@ SMbuf *smt_build_frame(struct s_smc *smc, int class, int type,
1111 1111
1112#if 0 1112#if 0
1113 if (!smc->r.sm_ma_avail) { 1113 if (!smc->r.sm_ma_avail) {
1114 return(0) ; 1114 return 0;
1115 } 1115 }
1116#endif 1116#endif
1117 if (!(mb = smt_get_mbuf(smc))) 1117 if (!(mb = smt_get_mbuf(smc)))
1118 return(mb) ; 1118 return mb;
1119 1119
1120 mb->sm_len = length ; 1120 mb->sm_len = length ;
1121 smt = smtod(mb, struct smt_header *) ; 1121 smt = smtod(mb, struct smt_header *) ;
@@ -1136,7 +1136,7 @@ SMbuf *smt_build_frame(struct s_smc *smc, int class, int type,
1136 smt->smt_tid = smt_get_tid(smc) ; /* set transaction ID */ 1136 smt->smt_tid = smt_get_tid(smc) ; /* set transaction ID */
1137 smt->smt_pad = 0 ; 1137 smt->smt_pad = 0 ;
1138 smt->smt_len = length - sizeof(struct smt_header) ; 1138 smt->smt_len = length - sizeof(struct smt_header) ;
1139 return(mb) ; 1139 return mb;
1140} 1140}
1141 1141
1142static void smt_add_frame_len(SMbuf *mb, int len) 1142static void smt_add_frame_len(SMbuf *mb, int len)
@@ -1263,7 +1263,7 @@ void smt_set_timestamp(struct s_smc *smc, u_char *p)
1263static void smt_fill_policy(struct s_smc *smc, struct smt_p_policy *policy) 1263static void smt_fill_policy(struct s_smc *smc, struct smt_p_policy *policy)
1264{ 1264{
1265 int i ; 1265 int i ;
1266 u_char *map ; 1266 const u_char *map ;
1267 u_short in ; 1267 u_short in ;
1268 u_short out ; 1268 u_short out ;
1269 1269
@@ -1271,7 +1271,7 @@ static void smt_fill_policy(struct s_smc *smc, struct smt_p_policy *policy)
1271 * MIB para 101b (fddiSMTConnectionPolicy) coding 1271 * MIB para 101b (fddiSMTConnectionPolicy) coding
1272 * is different from 0005 coding 1272 * is different from 0005 coding
1273 */ 1273 */
1274 static u_char ansi_weirdness[16] = { 1274 static const u_char ansi_weirdness[16] = {
1275 0,7,5,3,8,1,6,4,9,10,2,11,12,13,14,15 1275 0,7,5,3,8,1,6,4,9,10,2,11,12,13,14,15
1276 } ; 1276 } ;
1277 SMTSETPARA(policy,SMT_P_POLICY) ; 1277 SMTSETPARA(policy,SMT_P_POLICY) ;
@@ -1375,7 +1375,7 @@ static int smt_fill_path(struct s_smc *smc, struct smt_p_path *path)
1375 pd_mac = (struct smt_mac_rec *) phy ; 1375 pd_mac = (struct smt_mac_rec *) phy ;
1376 pd_mac->mac_addr = smc->mib.m[MAC0].fddiMACSMTAddress ; 1376 pd_mac->mac_addr = smc->mib.m[MAC0].fddiMACSMTAddress ;
1377 pd_mac->mac_resource_idx = mac_con_resource_index(smc,1) ; 1377 pd_mac->mac_resource_idx = mac_con_resource_index(smc,1) ;
1378 return(len) ; 1378 return len;
1379} 1379}
1380 1380
1381/* 1381/*
@@ -1563,7 +1563,7 @@ u_long smt_get_tid(struct s_smc *smc)
1563 u_long tid ; 1563 u_long tid ;
1564 while ((tid = ++(smc->sm.smt_tid) ^ SMT_TID_MAGIC) == 0) 1564 while ((tid = ++(smc->sm.smt_tid) ^ SMT_TID_MAGIC) == 0)
1565 ; 1565 ;
1566 return(tid & 0x3fffffffL) ; 1566 return tid & 0x3fffffffL;
1567} 1567}
1568 1568
1569 1569
@@ -1654,11 +1654,11 @@ int smt_check_para(struct s_smc *smc, struct smt_header *sm,
1654 while (*p) { 1654 while (*p) {
1655 if (!sm_to_para(smc,sm,(int) *p)) { 1655 if (!sm_to_para(smc,sm,(int) *p)) {
1656 DB_SMT("SMT: smt_check_para - missing para %x\n",*p,0); 1656 DB_SMT("SMT: smt_check_para - missing para %x\n",*p,0);
1657 return(-1) ; 1657 return -1;
1658 } 1658 }
1659 p++ ; 1659 p++ ;
1660 } 1660 }
1661 return(0) ; 1661 return 0;
1662} 1662}
1663 1663
1664void *sm_to_para(struct s_smc *smc, struct smt_header *sm, int para) 1664void *sm_to_para(struct s_smc *smc, struct smt_header *sm, int para)
@@ -1687,7 +1687,7 @@ void *sm_to_para(struct s_smc *smc, struct smt_header *sm, int para)
1687 return NULL; 1687 return NULL;
1688 } 1688 }
1689 if (found) 1689 if (found)
1690 return(found) ; 1690 return found;
1691 } 1691 }
1692 return NULL; 1692 return NULL;
1693} 1693}
@@ -1732,7 +1732,7 @@ char *addr_to_string(struct fddi_addr *addr)
1732 string[i * 3 + 2] = ':'; 1732 string[i * 3 + 2] = ':';
1733 } 1733 }
1734 string[5 * 3 + 2] = 0; 1734 string[5 * 3 + 2] = 0;
1735 return(string); 1735 return string;
1736} 1736}
1737#endif 1737#endif
1738 1738
@@ -1742,9 +1742,9 @@ int smt_ifconfig(int argc, char *argv[])
1742 if (argc >= 2 && !strcmp(argv[0],"opt_bypass") && 1742 if (argc >= 2 && !strcmp(argv[0],"opt_bypass") &&
1743 !strcmp(argv[1],"yes")) { 1743 !strcmp(argv[1],"yes")) {
1744 smc->mib.fddiSMTBypassPresent = 1 ; 1744 smc->mib.fddiSMTBypassPresent = 1 ;
1745 return(0) ; 1745 return 0;
1746 } 1746 }
1747 return(amdfddi_config(0,argc,argv)) ; 1747 return amdfddi_config(0, argc, argv);
1748} 1748}
1749#endif 1749#endif
1750 1750
@@ -1756,9 +1756,9 @@ static int mac_index(struct s_smc *smc, int mac)
1756 SK_UNUSED(mac) ; 1756 SK_UNUSED(mac) ;
1757#ifdef CONCENTRATOR 1757#ifdef CONCENTRATOR
1758 SK_UNUSED(smc) ; 1758 SK_UNUSED(smc) ;
1759 return(NUMPHYS+1) ; 1759 return NUMPHYS + 1;
1760#else 1760#else
1761 return((smc->s.sas == SMT_SAS) ? 2 : 3) ; 1761 return (smc->s.sas == SMT_SAS) ? 2 : 3;
1762#endif 1762#endif
1763} 1763}
1764 1764
@@ -1768,7 +1768,7 @@ static int mac_index(struct s_smc *smc, int mac)
1768static int phy_index(struct s_smc *smc, int phy) 1768static int phy_index(struct s_smc *smc, int phy)
1769{ 1769{
1770 SK_UNUSED(smc) ; 1770 SK_UNUSED(smc) ;
1771 return(phy+1); 1771 return phy + 1;
1772} 1772}
1773 1773
1774/* 1774/*
@@ -1779,19 +1779,19 @@ static int mac_con_resource_index(struct s_smc *smc, int mac)
1779#ifdef CONCENTRATOR 1779#ifdef CONCENTRATOR
1780 SK_UNUSED(smc) ; 1780 SK_UNUSED(smc) ;
1781 SK_UNUSED(mac) ; 1781 SK_UNUSED(mac) ;
1782 return(entity_to_index(smc,cem_get_downstream(smc,ENTITY_MAC))) ; 1782 return entity_to_index(smc, cem_get_downstream(smc, ENTITY_MAC));
1783#else 1783#else
1784 SK_UNUSED(mac) ; 1784 SK_UNUSED(mac) ;
1785 switch (smc->mib.fddiSMTCF_State) { 1785 switch (smc->mib.fddiSMTCF_State) {
1786 case SC9_C_WRAP_A : 1786 case SC9_C_WRAP_A :
1787 case SC5_THRU_B : 1787 case SC5_THRU_B :
1788 case SC11_C_WRAP_S : 1788 case SC11_C_WRAP_S :
1789 return(1) ; 1789 return 1;
1790 case SC10_C_WRAP_B : 1790 case SC10_C_WRAP_B :
1791 case SC4_THRU_A : 1791 case SC4_THRU_A :
1792 return(2) ; 1792 return 2;
1793 } 1793 }
1794 return(smc->s.sas == SMT_SAS ? 2 : 3) ; 1794 return smc->s.sas == SMT_SAS ? 2 : 3;
1795#endif 1795#endif
1796} 1796}
1797 1797
@@ -1801,21 +1801,21 @@ static int mac_con_resource_index(struct s_smc *smc, int mac)
1801static int phy_con_resource_index(struct s_smc *smc, int phy) 1801static int phy_con_resource_index(struct s_smc *smc, int phy)
1802{ 1802{
1803#ifdef CONCENTRATOR 1803#ifdef CONCENTRATOR
1804 return(entity_to_index(smc,cem_get_downstream(smc,ENTITY_PHY(phy)))) ; 1804 return entity_to_index(smc, cem_get_downstream(smc, ENTITY_PHY(phy))) ;
1805#else 1805#else
1806 switch (smc->mib.fddiSMTCF_State) { 1806 switch (smc->mib.fddiSMTCF_State) {
1807 case SC9_C_WRAP_A : 1807 case SC9_C_WRAP_A :
1808 return(phy == PA ? 3 : 2) ; 1808 return phy == PA ? 3 : 2;
1809 case SC10_C_WRAP_B : 1809 case SC10_C_WRAP_B :
1810 return(phy == PA ? 1 : 3) ; 1810 return phy == PA ? 1 : 3;
1811 case SC4_THRU_A : 1811 case SC4_THRU_A :
1812 return(phy == PA ? 3 : 1) ; 1812 return phy == PA ? 3 : 1;
1813 case SC5_THRU_B : 1813 case SC5_THRU_B :
1814 return(phy == PA ? 2 : 3) ; 1814 return phy == PA ? 2 : 3;
1815 case SC11_C_WRAP_S : 1815 case SC11_C_WRAP_S :
1816 return(2) ; 1816 return 2;
1817 } 1817 }
1818 return(phy) ; 1818 return phy;
1819#endif 1819#endif
1820} 1820}
1821 1821
@@ -1823,16 +1823,16 @@ static int phy_con_resource_index(struct s_smc *smc, int phy)
1823static int entity_to_index(struct s_smc *smc, int e) 1823static int entity_to_index(struct s_smc *smc, int e)
1824{ 1824{
1825 if (e == ENTITY_MAC) 1825 if (e == ENTITY_MAC)
1826 return(mac_index(smc,1)) ; 1826 return mac_index(smc, 1);
1827 else 1827 else
1828 return(phy_index(smc,e - ENTITY_PHY(0))) ; 1828 return phy_index(smc, e - ENTITY_PHY(0));
1829} 1829}
1830#endif 1830#endif
1831 1831
1832#ifdef LITTLE_ENDIAN 1832#ifdef LITTLE_ENDIAN
1833static int smt_swap_short(u_short s) 1833static int smt_swap_short(u_short s)
1834{ 1834{
1835 return(((s>>8)&0xff)|((s&0xff)<<8)) ; 1835 return ((s>>8)&0xff) | ((s&0xff)<<8);
1836} 1836}
1837 1837
1838void smt_swap_para(struct smt_header *sm, int len, int direction) 1838void smt_swap_para(struct smt_header *sm, int len, int direction)
@@ -1996,7 +1996,7 @@ int smt_action(struct s_smc *smc, int class, int code, int index)
1996 } 1996 }
1997 break ; 1997 break ;
1998 default : 1998 default :
1999 return(1) ; 1999 return 1;
2000 } 2000 }
2001 break ; 2001 break ;
2002 case SMT_PORT_ACTION : 2002 case SMT_PORT_ACTION :
@@ -2017,14 +2017,14 @@ int smt_action(struct s_smc *smc, int class, int code, int index)
2017 event = PC_STOP ; 2017 event = PC_STOP ;
2018 break ; 2018 break ;
2019 default : 2019 default :
2020 return(1) ; 2020 return 1;
2021 } 2021 }
2022 queue_event(smc,EVENT_PCM+index,event) ; 2022 queue_event(smc,EVENT_PCM+index,event) ;
2023 break ; 2023 break ;
2024 default : 2024 default :
2025 return(1) ; 2025 return 1;
2026 } 2026 }
2027 return(0) ; 2027 return 0;
2028} 2028}
2029 2029
2030/* 2030/*
diff --git a/drivers/net/skfp/smtdef.c b/drivers/net/skfp/smtdef.c
index 4e07ff7073f1..1acab0b368e3 100644
--- a/drivers/net/skfp/smtdef.c
+++ b/drivers/net/skfp/smtdef.c
@@ -303,7 +303,7 @@ int smt_set_mac_opvalues(struct s_smc *smc)
303 FDDI_SMT_EVENT, (u_long) FDDI_REMOTE_T_REQ, 303 FDDI_SMT_EVENT, (u_long) FDDI_REMOTE_T_REQ,
304 smt_get_event_word(smc)); 304 smt_get_event_word(smc));
305 } 305 }
306 return(st) ; 306 return st;
307} 307}
308 308
309void smt_fixup_mib(struct s_smc *smc) 309void smt_fixup_mib(struct s_smc *smc)
@@ -350,6 +350,6 @@ static int set_min_max(int maxflag, u_long mib, u_long limit, u_long *oper)
350 *oper = limit ; 350 *oper = limit ;
351 else 351 else
352 *oper = mib ; 352 *oper = mib ;
353 return(old != *oper) ; 353 return old != *oper;
354} 354}
355 355
diff --git a/drivers/net/skfp/smtinit.c b/drivers/net/skfp/smtinit.c
index 3c8964ce1837..e3a0c0bc2233 100644
--- a/drivers/net/skfp/smtinit.c
+++ b/drivers/net/skfp/smtinit.c
@@ -120,6 +120,6 @@ int init_smt(struct s_smc *smc, u_char *mac_addr)
120 120
121 PNMI_INIT(smc) ; /* PNMI initialization */ 121 PNMI_INIT(smc) ; /* PNMI initialization */
122 122
123 return(0) ; 123 return 0;
124} 124}
125 125
diff --git a/drivers/net/skfp/srf.c b/drivers/net/skfp/srf.c
index 40882b3faba6..f6f7baf9f27a 100644
--- a/drivers/net/skfp/srf.c
+++ b/drivers/net/skfp/srf.c
@@ -165,7 +165,7 @@ static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index)
165 165
166 for (i = 0, evc = smc->evcs ; (unsigned) i < MAX_EVCS ; i++, evc++) { 166 for (i = 0, evc = smc->evcs ; (unsigned) i < MAX_EVCS ; i++, evc++) {
167 if (evc->evc_code == code && evc->evc_index == index) 167 if (evc->evc_code == code && evc->evc_index == index)
168 return(evc) ; 168 return evc;
169 } 169 }
170 return NULL; 170 return NULL;
171} 171}