hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/drivers/net/fddi/skfp/smt.c
....@@ -1,14 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /******************************************************************************
23 *
34 * (C)Copyright 1998,1999 SysKonnect,
45 * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
56 *
67 * See the file "skfddi.c" for further information.
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; either version 2 of the License, or
11
- * (at your option) any later version.
128 *
139 * The information in this file is provided "AS IS" without warranty.
1410 *
....@@ -23,10 +19,6 @@
2319
2420 #define KERNEL
2521 #include "h/smtstate.h"
26
-
27
-#ifndef lint
28
-static const char ID_sccs[] = "@(#)smt.c 2.43 98/11/23 (C) SK " ;
29
-#endif
3022
3123 /*
3224 * FC in SMbuf
....@@ -524,8 +516,8 @@
524516 * ignore any packet with NSA and A-indicator set
525517 */
526518 if ( (fs & A_INDICATOR) && m_fc(mb) == FC_SMT_NSA) {
527
- DB_SMT("SMT : ignoring NSA with A-indicator set from %s",
528
- addr_to_string(&sm->smt_source));
519
+ DB_SMT("SMT : ignoring NSA with A-indicator set from %pM",
520
+ &sm->smt_source);
529521 smt_free_mbuf(smc,mb) ;
530522 return ;
531523 }
....@@ -556,8 +548,8 @@
556548 break ;
557549 }
558550 if (illegal) {
559
- DB_SMT("SMT : version = %d, dest = %s",
560
- sm->smt_version, addr_to_string(&sm->smt_source));
551
+ DB_SMT("SMT : version = %d, dest = %pM",
552
+ sm->smt_version, &sm->smt_source);
561553 smt_send_rdf(smc,mb,m_fc(mb),SMT_RDF_VERSION,local) ;
562554 smt_free_mbuf(smc,mb) ;
563555 return ;
....@@ -586,8 +578,8 @@
586578 if (!is_equal(
587579 &smc->mib.m[MAC0].fddiMACUpstreamNbr,
588580 &sm->smt_source)) {
589
- DB_SMT("SMT : updated my UNA = %s",
590
- addr_to_string(&sm->smt_source));
581
+ DB_SMT("SMT : updated my UNA = %pM",
582
+ &sm->smt_source);
591583 if (!is_equal(&smc->mib.m[MAC0].
592584 fddiMACUpstreamNbr,&SMT_Unknown)){
593585 /* Do not update unknown address */
....@@ -616,8 +608,8 @@
616608 is_individual(&sm->smt_source) &&
617609 ((!(fs & A_INDICATOR) && m_fc(mb) == FC_SMT_NSA) ||
618610 (m_fc(mb) != FC_SMT_NSA))) {
619
- DB_SMT("SMT : replying to NIF request %s",
620
- addr_to_string(&sm->smt_source));
611
+ DB_SMT("SMT : replying to NIF request %pM",
612
+ &sm->smt_source);
621613 smt_send_nif(smc,&sm->smt_source,
622614 FC_SMT_INFO,
623615 sm->smt_tid,
....@@ -625,8 +617,8 @@
625617 }
626618 break ;
627619 case SMT_REPLY :
628
- DB_SMT("SMT : received NIF response from %s",
629
- addr_to_string(&sm->smt_source));
620
+ DB_SMT("SMT : received NIF response from %pM",
621
+ &sm->smt_source);
630622 if (fs & A_INDICATOR) {
631623 smc->sm.pend[SMT_TID_NIF] = 0 ;
632624 DB_SMT("SMT : duplicate address");
....@@ -686,23 +678,23 @@
686678 case SMT_SIF_CONFIG : /* station information */
687679 if (sm->smt_type != SMT_REQUEST)
688680 break ;
689
- DB_SMT("SMT : replying to SIF Config request from %s",
690
- addr_to_string(&sm->smt_source));
681
+ DB_SMT("SMT : replying to SIF Config request from %pM",
682
+ &sm->smt_source);
691683 smt_send_sif_config(smc,&sm->smt_source,sm->smt_tid,local) ;
692684 break ;
693685 case SMT_SIF_OPER : /* station information */
694686 if (sm->smt_type != SMT_REQUEST)
695687 break ;
696
- DB_SMT("SMT : replying to SIF Operation request from %s",
697
- addr_to_string(&sm->smt_source));
688
+ DB_SMT("SMT : replying to SIF Operation request from %pM",
689
+ &sm->smt_source);
698690 smt_send_sif_operation(smc,&sm->smt_source,sm->smt_tid,local) ;
699691 break ;
700692 case SMT_ECF : /* echo frame */
701693 switch (sm->smt_type) {
702694 case SMT_REPLY :
703695 smc->mib.priv.fddiPRIVECF_Reply_Rx++ ;
704
- DB_SMT("SMT: received ECF reply from %s",
705
- addr_to_string(&sm->smt_source));
696
+ DB_SMT("SMT: received ECF reply from %pM",
697
+ &sm->smt_source);
706698 if (sm_to_para(smc,sm,SMT_P_ECHODATA) == NULL) {
707699 DB_SMT("SMT: ECHODATA missing");
708700 break ;
....@@ -731,8 +723,8 @@
731723 local) ;
732724 break ;
733725 }
734
- DB_SMT("SMT - sending ECF reply to %s",
735
- addr_to_string(&sm->smt_source));
726
+ DB_SMT("SMT - sending ECF reply to %pM",
727
+ &sm->smt_source);
736728
737729 /* set destination addr. & reply */
738730 sm->smt_dest = sm->smt_source ;
....@@ -798,8 +790,8 @@
798790 * we need to send a RDF frame according to 8.1.3.1.1,
799791 * only if it is a REQUEST.
800792 */
801
- DB_SMT("SMT : class = %d, send RDF to %s",
802
- sm->smt_class, addr_to_string(&sm->smt_source));
793
+ DB_SMT("SMT : class = %d, send RDF to %pM",
794
+ sm->smt_class, &sm->smt_source);
803795
804796 smt_send_rdf(smc,mb,m_fc(mb),SMT_RDF_CLASS,local) ;
805797 break ;
....@@ -868,8 +860,8 @@
868860 if (sm->smt_type != SMT_REQUEST)
869861 return ;
870862
871
- DB_SMT("SMT: sending RDF to %s,reason = 0x%x",
872
- addr_to_string(&sm->smt_source), reason);
863
+ DB_SMT("SMT: sending RDF to %pM,reason = 0x%x",
864
+ &sm->smt_source, reason);
873865
874866
875867 /*
....@@ -1565,7 +1557,7 @@
15651557 return tid & 0x3fffffffL;
15661558 }
15671559
1568
-
1560
+#ifdef LITTLE_ENDIAN
15691561 /*
15701562 * table of parameter lengths
15711563 */
....@@ -1645,6 +1637,7 @@
16451637 } ;
16461638
16471639 #define N_SMT_PLEN ARRAY_SIZE(smt_pdef)
1640
+#endif
16481641
16491642 int smt_check_para(struct s_smc *smc, struct smt_header *sm,
16501643 const u_short list[])
....@@ -1716,22 +1709,6 @@
17161709 smt->smt_source = smc->mib.m[MAC0].fddiMACSMTAddress ;
17171710 smt_send_mbuf(smc,mb,FC_ASYNC_LLC) ;
17181711 #endif
1719
-}
1720
-#endif
1721
-
1722
-#ifdef DEBUG
1723
-char *addr_to_string(struct fddi_addr *addr)
1724
-{
1725
- int i ;
1726
- static char string[6*3] = "****" ;
1727
-
1728
- for (i = 0 ; i < 6 ; i++) {
1729
- string[i * 3] = hex_asc_hi(addr->a[i]);
1730
- string[i * 3 + 1] = hex_asc_lo(addr->a[i]);
1731
- string[i * 3 + 2] = ':';
1732
- }
1733
- string[5 * 3 + 2] = 0;
1734
- return string;
17351712 }
17361713 #endif
17371714