Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f48b9db authored by Eugene Crosser's avatar Eugene Crosser Committed by David S. Miller
Browse files

qeth: bridgeport support - address notifications



Introduce functions to enable and disable bridgeport address
notification feature, sysfs attributes for access to these
functions from userspace, and udev events emitted when a host
joins or exits a bridgeport-enabled HiperSocket channel.

Signed-off-by: default avatarEugene Crosser <eugene.crosser@ru.ibm.com>
Signed-off-by: default avatarFrank Blaschka <frank.blaschka@de.ibm.com>
Reviewed-by: default avatarUrsula Braun <ursula.braun@de.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 59b55a4d
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -19,3 +19,32 @@ BRIDGEPORT=statechange - indicates that the Bridge Port device changed
ROLE={primary|secondary|none} - the role assigned to the port.

STATE={active|standby|inactive} - the newly assumed state of the port.

When run on HiperSockets Bridge Capable Port hardware with host address
notifications enabled, a udev event with ACTION=CHANGE is emitted.
It is emitted on behalf of the corresponding ccwgroup device when a host
or a VLAN is registered or unregistered on the network served by the device.
The event has the following attributes:

BRIDGEDHOST={reset|register|deregister|abort} - host address
  notifications are started afresh, a new host or VLAN is registered or
  deregistered on the Bridge Port HiperSockets channel, or address
  notifications are aborted.

VLAN=numeric-vlan-id - VLAN ID on which the event occurred. Not included
  if no VLAN is involved in the event.

MAC=xx:xx:xx:xx:xx:xx - MAC address of the host that is being registered
  or deregistered from the HiperSockets channel. Not reported if the
  event reports the creation or destruction of a VLAN.

NTOK_BUSID=x.y.zzzz - device bus ID (CSSID, SSID and device number).

NTOK_IID=xx - device IID.

NTOK_CHPID=xx - device CHPID.

NTOK_CHID=xxxx - device channel ID.

Note that the NTOK_* attributes refer to devices other than  the one
connected to the system on which the OS is running.
+5 −0
Original line number Diff line number Diff line
@@ -169,9 +169,12 @@ enum qeth_sbp_states {
	QETH_SBP_STATE_ACTIVE	= 2,
};

#define QETH_SBP_HOST_NOTIFICATION 1

struct qeth_sbp_info {
	__u32 supported_funcs;
	enum qeth_sbp_roles role;
	__u32 hostnotification:1;
};

static inline int qeth_is_ipa_supported(struct qeth_ipa_info *ipa,
@@ -950,6 +953,8 @@ void qeth_bridgeport_query_support(struct qeth_card *card);
int qeth_bridgeport_query_ports(struct qeth_card *card,
	enum qeth_sbp_roles *role, enum qeth_sbp_states *state);
int qeth_bridgeport_setrole(struct qeth_card *card, enum qeth_sbp_roles role);
int qeth_bridgeport_an_set(struct qeth_card *card, int enable);
void qeth_bridge_host_event(struct qeth_card *card, struct qeth_ipa_cmd *cmd);
int qeth_get_priority_queue(struct qeth_card *, struct sk_buff *, int, int);
int qeth_get_elements_no(struct qeth_card *, struct sk_buff *, int);
int qeth_get_elements_for_frags(struct sk_buff *);
+3 −0
Original line number Diff line number Diff line
@@ -622,6 +622,9 @@ static struct qeth_ipa_cmd *qeth_check_ipa_data(struct qeth_card *card,
					return NULL;
				} else
					return cmd;
			case IPA_CMD_ADDRESS_CHANGE_NOTIF:
				qeth_bridge_host_event(card, cmd);
				return NULL;
			case IPA_CMD_MODCCID:
				return cmd;
			case IPA_CMD_REGISTER_LOCAL_ADDR:
+1 −0
Original line number Diff line number Diff line
@@ -254,6 +254,7 @@ static struct ipa_cmd_names qeth_ipa_cmd_names[] = {
	{IPA_CMD_DESTROY_ADDR,	"destroy_addr"},
	{IPA_CMD_REGISTER_LOCAL_ADDR,	"register_local_addr"},
	{IPA_CMD_UNREGISTER_LOCAL_ADDR,	"unregister_local_addr"},
	{IPA_CMD_ADDRESS_CHANGE_NOTIF, "address_change_notification"},
	{IPA_CMD_UNKNOWN,	"unknown"},
};

+38 −0
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ enum qeth_ipa_cmds {
	IPA_CMD_DESTROY_ADDR		= 0xc4,
	IPA_CMD_REGISTER_LOCAL_ADDR	= 0xd1,
	IPA_CMD_UNREGISTER_LOCAL_ADDR	= 0xd2,
	IPA_CMD_ADDRESS_CHANGE_NOTIF	= 0xd3,
	IPA_CMD_UNKNOWN			= 0x00
};

@@ -520,6 +521,11 @@ struct net_if_token {
	__u16 chid;
} __packed;

struct mac_addr_lnid {
	__u8 mac[6];
	__u16 lnid;
} __packed;

struct qeth_ipacmd_sbp_hdr {
	__u32 supported_sbp_cmds;
	__u32 enabled_sbp_cmds;
@@ -583,6 +589,37 @@ struct qeth_ipacmd_setbridgeport {
	} data;
} __packed;

/* ADDRESS_CHANGE_NOTIFICATION adapter-initiated "command" *******************/
/* Bitmask for entry->change_code. Both bits may be raised.		     */
enum qeth_ipa_addr_change_code {
	IPA_ADDR_CHANGE_CODE_VLANID		= 0x01,
	IPA_ADDR_CHANGE_CODE_MACADDR		= 0x02,
	IPA_ADDR_CHANGE_CODE_REMOVAL		= 0x80,	/* else addition */
};
enum qeth_ipa_addr_change_retcode {
	IPA_ADDR_CHANGE_RETCODE_OK		= 0x0000,
	IPA_ADDR_CHANGE_RETCODE_LOSTEVENTS	= 0x0010,
};
enum qeth_ipa_addr_change_lostmask {
	IPA_ADDR_CHANGE_MASK_OVERFLOW		= 0x01,
	IPA_ADDR_CHANGE_MASK_STATECHANGE	= 0x02,
};

struct qeth_ipacmd_addr_change_entry {
	struct net_if_token token;
	struct mac_addr_lnid addr_lnid;
	__u8 change_code;
	__u8 reserved1;
	__u16 reserved2;
} __packed;

struct qeth_ipacmd_addr_change {
	__u8 lost_event_mask;
	__u8 reserved;
	__u16 num_entries;
	struct qeth_ipacmd_addr_change_entry entry[];
} __packed;

/* Header for each IPA command */
struct qeth_ipacmd_hdr {
	__u8   command;
@@ -613,6 +650,7 @@ struct qeth_ipa_cmd {
		struct qeth_set_routing			setrtg;
		struct qeth_ipacmd_diagass		diagass;
		struct qeth_ipacmd_setbridgeport	sbp;
		struct qeth_ipacmd_addr_change		addrchange;
	} data;
} __attribute__ ((packed));

Loading