.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /****************************************************************************** |
---|
2 | 3 | * |
---|
3 | 4 | * (C)Copyright 1998,1999 SysKonnect, |
---|
4 | 5 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. |
---|
5 | 6 | * |
---|
6 | 7 | * 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. |
---|
12 | 8 | * |
---|
13 | 9 | * The information in this file is provided "AS IS" without warranty. |
---|
14 | 10 | * |
---|
.. | .. |
---|
23 | 19 | |
---|
24 | 20 | #define KERNEL |
---|
25 | 21 | #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 |
---|
30 | 22 | |
---|
31 | 23 | /* |
---|
32 | 24 | * FC in SMbuf |
---|
.. | .. |
---|
524 | 516 | * ignore any packet with NSA and A-indicator set |
---|
525 | 517 | */ |
---|
526 | 518 | 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); |
---|
529 | 521 | smt_free_mbuf(smc,mb) ; |
---|
530 | 522 | return ; |
---|
531 | 523 | } |
---|
.. | .. |
---|
556 | 548 | break ; |
---|
557 | 549 | } |
---|
558 | 550 | 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); |
---|
561 | 553 | smt_send_rdf(smc,mb,m_fc(mb),SMT_RDF_VERSION,local) ; |
---|
562 | 554 | smt_free_mbuf(smc,mb) ; |
---|
563 | 555 | return ; |
---|
.. | .. |
---|
586 | 578 | if (!is_equal( |
---|
587 | 579 | &smc->mib.m[MAC0].fddiMACUpstreamNbr, |
---|
588 | 580 | &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); |
---|
591 | 583 | if (!is_equal(&smc->mib.m[MAC0]. |
---|
592 | 584 | fddiMACUpstreamNbr,&SMT_Unknown)){ |
---|
593 | 585 | /* Do not update unknown address */ |
---|
.. | .. |
---|
616 | 608 | is_individual(&sm->smt_source) && |
---|
617 | 609 | ((!(fs & A_INDICATOR) && m_fc(mb) == FC_SMT_NSA) || |
---|
618 | 610 | (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); |
---|
621 | 613 | smt_send_nif(smc,&sm->smt_source, |
---|
622 | 614 | FC_SMT_INFO, |
---|
623 | 615 | sm->smt_tid, |
---|
.. | .. |
---|
625 | 617 | } |
---|
626 | 618 | break ; |
---|
627 | 619 | 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); |
---|
630 | 622 | if (fs & A_INDICATOR) { |
---|
631 | 623 | smc->sm.pend[SMT_TID_NIF] = 0 ; |
---|
632 | 624 | DB_SMT("SMT : duplicate address"); |
---|
.. | .. |
---|
686 | 678 | case SMT_SIF_CONFIG : /* station information */ |
---|
687 | 679 | if (sm->smt_type != SMT_REQUEST) |
---|
688 | 680 | 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); |
---|
691 | 683 | smt_send_sif_config(smc,&sm->smt_source,sm->smt_tid,local) ; |
---|
692 | 684 | break ; |
---|
693 | 685 | case SMT_SIF_OPER : /* station information */ |
---|
694 | 686 | if (sm->smt_type != SMT_REQUEST) |
---|
695 | 687 | 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); |
---|
698 | 690 | smt_send_sif_operation(smc,&sm->smt_source,sm->smt_tid,local) ; |
---|
699 | 691 | break ; |
---|
700 | 692 | case SMT_ECF : /* echo frame */ |
---|
701 | 693 | switch (sm->smt_type) { |
---|
702 | 694 | case SMT_REPLY : |
---|
703 | 695 | 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); |
---|
706 | 698 | if (sm_to_para(smc,sm,SMT_P_ECHODATA) == NULL) { |
---|
707 | 699 | DB_SMT("SMT: ECHODATA missing"); |
---|
708 | 700 | break ; |
---|
.. | .. |
---|
731 | 723 | local) ; |
---|
732 | 724 | break ; |
---|
733 | 725 | } |
---|
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); |
---|
736 | 728 | |
---|
737 | 729 | /* set destination addr. & reply */ |
---|
738 | 730 | sm->smt_dest = sm->smt_source ; |
---|
.. | .. |
---|
798 | 790 | * we need to send a RDF frame according to 8.1.3.1.1, |
---|
799 | 791 | * only if it is a REQUEST. |
---|
800 | 792 | */ |
---|
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); |
---|
803 | 795 | |
---|
804 | 796 | smt_send_rdf(smc,mb,m_fc(mb),SMT_RDF_CLASS,local) ; |
---|
805 | 797 | break ; |
---|
.. | .. |
---|
868 | 860 | if (sm->smt_type != SMT_REQUEST) |
---|
869 | 861 | return ; |
---|
870 | 862 | |
---|
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); |
---|
873 | 865 | |
---|
874 | 866 | |
---|
875 | 867 | /* |
---|
.. | .. |
---|
1565 | 1557 | return tid & 0x3fffffffL; |
---|
1566 | 1558 | } |
---|
1567 | 1559 | |
---|
1568 | | - |
---|
| 1560 | +#ifdef LITTLE_ENDIAN |
---|
1569 | 1561 | /* |
---|
1570 | 1562 | * table of parameter lengths |
---|
1571 | 1563 | */ |
---|
.. | .. |
---|
1645 | 1637 | } ; |
---|
1646 | 1638 | |
---|
1647 | 1639 | #define N_SMT_PLEN ARRAY_SIZE(smt_pdef) |
---|
| 1640 | +#endif |
---|
1648 | 1641 | |
---|
1649 | 1642 | int smt_check_para(struct s_smc *smc, struct smt_header *sm, |
---|
1650 | 1643 | const u_short list[]) |
---|
.. | .. |
---|
1716 | 1709 | smt->smt_source = smc->mib.m[MAC0].fddiMACSMTAddress ; |
---|
1717 | 1710 | smt_send_mbuf(smc,mb,FC_ASYNC_LLC) ; |
---|
1718 | 1711 | #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; |
---|
1735 | 1712 | } |
---|
1736 | 1713 | #endif |
---|
1737 | 1714 | |
---|