be2net: set and query VEB/VEPA mode of the PF interface
Subsystems (3)
PATCH 1/1 be2net: set and query VEB/VEPA mode of the PF interface
SkyHawk-R can support VEB or VEPA mode.
This patch will allow the user to set/query this switch setting.
Signed-off-by Ajit Khaparde <[email protected]>
--- drivers/net/ethernet/emulex/benet/be_cmds.c | 27 ++++++++-- drivers/net/ethernet/emulex/benet/be_cmds.h | 17 ++++-- drivers/net/ethernet/emulex/benet/be_main.c | 77 +++++++++++++++++++++++++- 3 files changed, 108 insertions(+), 13 deletions(-)
drivers/net/ethernet/emulex/benet/be_cmds.c +22 -5
@@ -2876,7 +2876,7 @@ int be_cmd_set_mac(struct be_adapter *adapter, u8 *mac, int if_id, u32 dom) }int be_cmd_set_hsw_config (struct be_adapter *adapter,u16 pvid, -u32 domain,u16 intf_id) +u32 domain,u16 intf_id,u16 hsw_mode) {struct be_mcc_wrb *wrb;struct be_cmd_req_set_hsw_config *req;
@@ -2903,6 +2903,13 @@ int be_cmd_set_hsw_config(struct be_adapter *adapter, u16 pvid, AMAP_SET_BITS(struct amap_set_hsw_context, pvid_valid, ctxt, 1); AMAP_SET_BITS(struct amap_set_hsw_context, pvid, ctxt, pvid); } +if (!BEx_chip (adapter) && hsw_mode) { + AMAP_SET_BITS(struct amap_set_hsw_context, interface_id, + ctxt, adapter->hba_port_num); + AMAP_SET_BITS(struct amap_set_hsw_context, pport, ctxt, 1); + AMAP_SET_BITS(struct amap_set_hsw_context, port_fwd_type, + ctxt, hsw_mode); + }be_dws_cpu_to_le (req->context,sizeof (req->context)); status =be_mcc_notify_wait (adapter);
@@ -2914,7 +2921,7 @@ err:/* Get Hyper switch config */ int be_cmd_get_hsw_config (struct be_adapter *adapter,u16 *pvid, -u32 domain,u16 intf_id) +u32 domain,u16 intf_id,u8 *mode) {struct be_mcc_wrb *wrb;struct be_cmd_req_get_hsw_config *req;
@@ -2937,9 +2944,15 @@ int be_cmd_get_hsw_config(struct be_adapter *adapter, u16 *pvid, OPCODE_COMMON_GET_HSW_CONFIG, sizeof(*req), wrb, NULL); req->hdr.domain = domain; - AMAP_SET_BITS(struct amap_get_hsw_req_context, interface_id, ctxt, - intf_id); + AMAP_SET_BITS(struct amap_get_hsw_req_context, interface_id, + ctxt, intf_id); AMAP_SET_BITS(struct amap_get_hsw_req_context, pvid_valid, ctxt, 1); + +if (!BEx_chip (adapter)) { + AMAP_SET_BITS(struct amap_get_hsw_req_context, interface_id, + ctxt, adapter->hba_port_num); + AMAP_SET_BITS(struct amap_get_hsw_req_context, pport, ctxt, 1); + }be_dws_cpu_to_le (req->context,sizeof (req->context)); status =be_mcc_notify_wait (adapter);
@@ -2950,7 +2963,11 @@ int be_cmd_get_hsw_config(struct be_adapter *adapter, u16 *pvid, sizeof(resp->context)); vid = AMAP_GET_BITS(struct amap_get_hsw_resp_context, pvid, &resp->context); - *pvid =le16_to_cpu (vid); +if (pvid) + *pvid =le16_to_cpu (vid); +if (mode) + *mode = AMAP_GET_BITS(struct amap_get_hsw_resp_context, + port_fwd_type, &resp->context); } err:
drivers/net/ethernet/emulex/benet/be_cmds.h +12 -5
@@ -1533,12 +1533,17 @@ struct be_cmd_req_set_mac_list { } __packed;/*********************** HSW Config ***********************/ +#define PORT_FWD_TYPE_VEPA 0x3 +#define PORT_FWD_TYPE_VEB 0x2 +struct amap_set_hsw_context {u8 interface_id[16 ];u8 rsvd0[14 ];u8 pvid_valid; -u8 rsvd1; -u8 rsvd2[16 ]; +u8 pport; +u8 rsvd1[6 ]; +u8 port_fwd_type[3 ]; +u8 rsvd2[7 ];u8 pvid[16 ];u8 rsvd3[32 ];u8 rsvd4[32 ];
@@ -1563,7 +1568,9 @@ struct amap_get_hsw_req_context { } __packed;struct amap_get_hsw_resp_context { -u8 rsvd1[16 ]; +u8 rsvd0[6 ]; +u8 port_fwd_type[3 ]; +u8 rsvd1[7 ];u8 pvid[16 ];u8 rsvd2[32 ];u8 rsvd3[32 ];
@@ -1965,9 +1972,9 @@ extern int be_cmd_set_mac_list(struct be_adapter *adapter, u8 *mac_array,extern int be_cmd_set_mac (struct be_adapter *adapter,u8 *mac,int if_id,u32 dom);extern int be_cmd_set_hsw_config (struct be_adapter *adapter,u16 pvid, -u32 domain,u16 intf_id); +u32 domain,u16 intf_id,u16 hsw_mode);extern int be_cmd_get_hsw_config (struct be_adapter *adapter,u16 *pvid, -u32 domain,u16 intf_id); +u32 domain,u16 intf_id,u8 *mode);extern int be_cmd_get_acpi_wol_cap (struct be_adapter *adapter);extern int be_cmd_get_ext_fat_capabilites (struct be_adapter *adapter,struct be_dma_mem *cmd);
drivers/net/ethernet/emulex/benet/be_main.c +74 -3
113 lines not on this page · raw message
Signature · 1 line
1.7.1
From: Ajit Khaparde <[email protected]>
Date: Fri, 30 Aug 2013 15:01:16 -0500
Quoted 4 lines
SkyHawk-R can support VEB or VEPA mode.
This patch will allow the user to set/query this switch setting.Signed-off-by Ajit Khaparde <[email protected]>
Applied, thanks.