41 #define ENOTSUP_PROTOCOL __einfo_error ( EINFO_ENOTSUP_PROTOCOL ) 42 #define EINFO_ENOTSUP_PROTOCOL \ 43 __einfo_uniqify ( EINFO_ENOTSUP, 0x02, \ 44 "Non-STP packet received" ) 45 #define ENOTSUP_VERSION __einfo_error ( EINFO_ENOTSUP_VERSION ) 46 #define EINFO_ENOTSUP_VERSION \ 47 __einfo_uniqify ( EINFO_ENOTSUP, 0x03, \ 48 "Legacy STP packet received" ) 49 #define ENOTSUP_TYPE __einfo_error ( EINFO_ENOTSUP_TYPE ) 50 #define EINFO_ENOTSUP_TYPE \ 51 __einfo_uniqify ( EINFO_ENOTSUP, 0x04, \ 52 "Non-RSTP packet received" ) 72 if (
iob_len ( iobuf ) <
sizeof ( *stp ) ) {
73 DBGC (
netdev,
"STP %s received underlength packet (%zd " 83 DBGC (
netdev,
"STP %s ignoring non-STP packet (protocol " 89 DBGC (
netdev,
"STP %s received legacy STP packet (version " 95 DBGC (
netdev,
"STP %s received non-RSTP packet (type %#02x)\n",
102 DBGC2 (
netdev,
"STP %s %s port %#04x flags %#02x hello %d delay %d\n",
109 DBGC (
netdev,
"STP %s %s port %#04x flags %#02x is not " 121 DBGC (
netdev,
"STP %s %s port %#04x flags %#02x is " #define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
const char * name
Protocol name.
#define TICKS_PER_SEC
Number of ticks per second.
uint16_t protocol
Protocol ID.
A Spanning Tree bridge protocol data unit.
uint8_t version
Protocol version.
static const char * stp_ntoa(const void *net_addr __unused)
Transcribe STP address.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
struct stp_switch sender
Sender switch.
static int netdev_link_blocked(struct net_device *netdev)
Check link block state of network device.
void netdev_link_block(struct net_device *netdev, unsigned long timeout)
Mark network device link as being blocked.
#define __unused
Declare a variable or data structure as unused.
void netdev_link_unblock(struct net_device *netdev)
Mark network device link as being unblocked.
#define STP_TYPE_RSTP
Rapid Spanning Tree bridge PDU type.
static struct net_device * netdev
Spanning Tree Protocol (STP)
uint16_t delay
Forward delay.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
uint16_t hello
Hello time.
uint8_t type
Message type.
uint8_t mac[ETH_ALEN]
MAC address.
#define STP_FL_FORWARDING
Port is forwarding.
#define STP_PROTOCOL
Spanning Tree protocol ID.
A network-layer protocol.
static int stp_rx(struct io_buffer *iobuf, struct net_device *netdev, const void *ll_dest __unused, const void *ll_source __unused, unsigned int flags __unused)
Process incoming STP packets.
Network device management.
char name[NETDEV_NAME_LEN]
Name of this network device.
void * data
Start of data.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define ETH_P_STP
"Protocol" value for STP
#define STP_VERSION_RSTP
Rapid Spanning Tree protocol version.
uint16_t hello
Hello time.
#define ENETUNREACH
Network unreachable.
struct bofm_section_header done
struct net_protocol stp_protocol __net_protocol
STP network protocol.