Commit faa4f796 authored by Sreenivasa Honnur's avatar Sreenivasa Honnur Committed by David S. Miller

[S2IO]: Support for add/delete/store/restore ethernet addresses

- Support to add/delete/store/restore 64 and 128 Ethernet addresses for Xframe I and Xframe II respectively.
Signed-off-by: default avatarSreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent db0ce50d
...@@ -723,11 +723,17 @@ struct XENA_dev_config { ...@@ -723,11 +723,17 @@ struct XENA_dev_config {
u64 rmac_cfg_key; u64 rmac_cfg_key;
#define RMAC_CFG_KEY(val) vBIT(val,0,16) #define RMAC_CFG_KEY(val) vBIT(val,0,16)
#define MAX_MAC_ADDRESSES 16 #define S2IO_MAC_ADDR_START_OFFSET 0
#define MAX_MC_ADDRESSES 32 /* Multicast addresses */
#define MAC_MAC_ADDR_START_OFFSET 0 #define S2IO_XENA_MAX_MC_ADDRESSES 64 /* multicast addresses */
#define MAC_MC_ADDR_START_OFFSET 16 #define S2IO_HERC_MAX_MC_ADDRESSES 256
#define MAC_MC_ALL_MC_ADDR_OFFSET 63 /* enables all multicast pkts */
#define S2IO_XENA_MAX_MAC_ADDRESSES 16
#define S2IO_HERC_MAX_MAC_ADDRESSES 64
#define S2IO_XENA_MC_ADDR_START_OFFSET 16
#define S2IO_HERC_MC_ADDR_START_OFFSET 64
u64 rmac_addr_cmd_mem; u64 rmac_addr_cmd_mem;
#define RMAC_ADDR_CMD_MEM_WE s2BIT(7) #define RMAC_ADDR_CMD_MEM_WE s2BIT(7)
#define RMAC_ADDR_CMD_MEM_RD 0 #define RMAC_ADDR_CMD_MEM_RD 0
......
This diff is collapsed.
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#define SUCCESS 0 #define SUCCESS 0
#define FAILURE -1 #define FAILURE -1
#define S2IO_MINUS_ONE 0xFFFFFFFFFFFFFFFFULL #define S2IO_MINUS_ONE 0xFFFFFFFFFFFFFFFFULL
#define S2IO_DISABLE_MAC_ENTRY 0xFFFFFFFFFFFFULL
#define S2IO_MAX_PCI_CONFIG_SPACE_REINIT 100 #define S2IO_MAX_PCI_CONFIG_SPACE_REINIT 100
#define S2IO_BIT_RESET 1 #define S2IO_BIT_RESET 1
#define S2IO_BIT_SET 2 #define S2IO_BIT_SET 2
...@@ -458,6 +459,9 @@ struct config_param { ...@@ -458,6 +459,9 @@ struct config_param {
#define MAX_MTU_JUMBO (MAX_PYLD_JUMBO+18) #define MAX_MTU_JUMBO (MAX_PYLD_JUMBO+18)
#define MAX_MTU_JUMBO_VLAN (MAX_PYLD_JUMBO+22) #define MAX_MTU_JUMBO_VLAN (MAX_PYLD_JUMBO+22)
u16 bus_speed; u16 bus_speed;
int max_mc_addr; /* xena=64 herc=256 */
int max_mac_addr; /* xena=16 herc=64 */
int mc_start_offset; /* xena=16 herc=64 */
}; };
/* Structure representing MAC Addrs */ /* Structure representing MAC Addrs */
...@@ -826,7 +830,7 @@ struct s2io_nic { ...@@ -826,7 +830,7 @@ struct s2io_nic {
#define MAX_MAC_SUPPORTED 16 #define MAX_MAC_SUPPORTED 16
#define MAX_SUPPORTED_MULTICASTS MAX_MAC_SUPPORTED #define MAX_SUPPORTED_MULTICASTS MAX_MAC_SUPPORTED
struct mac_addr def_mac_addr[MAX_MAC_SUPPORTED]; struct mac_addr def_mac_addr[256];
struct net_device_stats stats; struct net_device_stats stats;
int high_dma_flag; int high_dma_flag;
...@@ -853,7 +857,7 @@ struct s2io_nic { ...@@ -853,7 +857,7 @@ struct s2io_nic {
#define MAX_ADDRS_SUPPORTED 64 #define MAX_ADDRS_SUPPORTED 64
u16 usr_addr_count; u16 usr_addr_count;
u16 mc_addr_count; u16 mc_addr_count;
struct usr_addr usr_addrs[MAX_ADDRS_SUPPORTED]; struct usr_addr usr_addrs[256];
u16 m_cast_flg; u16 m_cast_flg;
u16 all_multi_pos; u16 all_multi_pos;
...@@ -1066,6 +1070,12 @@ static int s2io_add_isr(struct s2io_nic * sp); ...@@ -1066,6 +1070,12 @@ static int s2io_add_isr(struct s2io_nic * sp);
static void s2io_rem_isr(struct s2io_nic * sp); static void s2io_rem_isr(struct s2io_nic * sp);
static void restore_xmsi_data(struct s2io_nic *nic); static void restore_xmsi_data(struct s2io_nic *nic);
static void do_s2io_store_unicast_mc(struct s2io_nic *sp);
static void do_s2io_restore_unicast_mc(struct s2io_nic *sp);
static u64 do_s2io_read_unicast_mc(struct s2io_nic *sp, int offset);
static int do_s2io_add_mc(struct s2io_nic *sp, u8 *addr);
static int do_s2io_add_mac(struct s2io_nic *sp, u64 addr, int offset);
static int do_s2io_delete_unicast_mc(struct s2io_nic *sp, u64 addr);
static int static int
s2io_club_tcp_session(u8 *buffer, u8 **tcp, u32 *tcp_len, struct lro **lro, s2io_club_tcp_session(u8 *buffer, u8 **tcp, u32 *tcp_len, struct lro **lro,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment