diff options
author | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2017-08-28 02:18:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-28 19:49:49 -0400 |
commit | 21acf63013ed3d6fce3176cc34b74064052a31b4 (patch) | |
tree | f1bbaf1448d78d8bad745074677633add4e55724 /net/ncsi/internal.h | |
parent | 8579a67e139b77a6881c405f9272afb9a7891201 (diff) |
net/ncsi: Configure VLAN tag filter
Make use of the ndo_vlan_rx_{add,kill}_vid callbacks to have the NCSI
stack process new VLAN tags and configure the channel VLAN filter
appropriately.
Several VLAN tags can be set and a "Set VLAN Filter" packet must be sent
for each one, meaning the ncsi_dev_state_config_svf state must be
repeated. An internal list of VLAN tags is maintained, and compared
against the current channel's ncsi_channel_filter in order to keep track
within the state. VLAN filters are removed in a similar manner, with the
introduction of the ncsi_dev_state_config_clear_vids state. The maximum
number of VLAN tag filters is determined by the "Get Capabilities"
response from the channel.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ncsi/internal.h')
-rw-r--r-- | net/ncsi/internal.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/ncsi/internal.h b/net/ncsi/internal.h index 1308a56f2591..af3d636534ef 100644 --- a/net/ncsi/internal.h +++ b/net/ncsi/internal.h | |||
@@ -180,6 +180,7 @@ struct ncsi_channel { | |||
180 | #define NCSI_CHANNEL_INACTIVE 1 | 180 | #define NCSI_CHANNEL_INACTIVE 1 |
181 | #define NCSI_CHANNEL_ACTIVE 2 | 181 | #define NCSI_CHANNEL_ACTIVE 2 |
182 | #define NCSI_CHANNEL_INVISIBLE 3 | 182 | #define NCSI_CHANNEL_INVISIBLE 3 |
183 | bool reconfigure_needed; | ||
183 | spinlock_t lock; /* Protect filters etc */ | 184 | spinlock_t lock; /* Protect filters etc */ |
184 | struct ncsi_package *package; | 185 | struct ncsi_package *package; |
185 | struct ncsi_channel_version version; | 186 | struct ncsi_channel_version version; |
@@ -235,6 +236,9 @@ enum { | |||
235 | ncsi_dev_state_probe_dp, | 236 | ncsi_dev_state_probe_dp, |
236 | ncsi_dev_state_config_sp = 0x0301, | 237 | ncsi_dev_state_config_sp = 0x0301, |
237 | ncsi_dev_state_config_cis, | 238 | ncsi_dev_state_config_cis, |
239 | ncsi_dev_state_config_clear_vids, | ||
240 | ncsi_dev_state_config_svf, | ||
241 | ncsi_dev_state_config_ev, | ||
238 | ncsi_dev_state_config_sma, | 242 | ncsi_dev_state_config_sma, |
239 | ncsi_dev_state_config_ebf, | 243 | ncsi_dev_state_config_ebf, |
240 | #if IS_ENABLED(CONFIG_IPV6) | 244 | #if IS_ENABLED(CONFIG_IPV6) |
@@ -253,6 +257,12 @@ enum { | |||
253 | ncsi_dev_state_suspend_done | 257 | ncsi_dev_state_suspend_done |
254 | }; | 258 | }; |
255 | 259 | ||
260 | struct vlan_vid { | ||
261 | struct list_head list; | ||
262 | __be16 proto; | ||
263 | u16 vid; | ||
264 | }; | ||
265 | |||
256 | struct ncsi_dev_priv { | 266 | struct ncsi_dev_priv { |
257 | struct ncsi_dev ndev; /* Associated NCSI device */ | 267 | struct ncsi_dev ndev; /* Associated NCSI device */ |
258 | unsigned int flags; /* NCSI device flags */ | 268 | unsigned int flags; /* NCSI device flags */ |
@@ -276,6 +286,7 @@ struct ncsi_dev_priv { | |||
276 | struct work_struct work; /* For channel management */ | 286 | struct work_struct work; /* For channel management */ |
277 | struct packet_type ptype; /* NCSI packet Rx handler */ | 287 | struct packet_type ptype; /* NCSI packet Rx handler */ |
278 | struct list_head node; /* Form NCSI device list */ | 288 | struct list_head node; /* Form NCSI device list */ |
289 | struct list_head vlan_vids; /* List of active VLAN IDs */ | ||
279 | }; | 290 | }; |
280 | 291 | ||
281 | struct ncsi_cmd_arg { | 292 | struct ncsi_cmd_arg { |