mka: Remove "channel" hacks from the stack and the macsec_qca driver
This is specific to the macsec_qca driver. The core implementation shouldn't care about this, and only deal with the complete secure channel, and pass this down to the driver. Drivers that have such limitations should take care of these in their ->create functions and throw an error. Since the core MKA no longer saves the channel number, the macsec_qca driver must be able to recover it. Add a map (which is just an array since it's quite short) to match SCIs to channel numbers, and lookup functions that will be called in every place where functions would get the channel from the core code. Getting an available channel should be part of channel creation, instead of being a preparation step. Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
This commit is contained in:
parent
7d8f795003
commit
6f551abdfc
8 changed files with 159 additions and 153 deletions
|
@ -80,8 +80,6 @@ struct transmit_sc {
|
|||
u8 enciphering_sa; /* AN encipheringSA (read only) */
|
||||
|
||||
/* not defined data */
|
||||
unsigned int channel;
|
||||
|
||||
struct dl_list list;
|
||||
struct dl_list sa_list;
|
||||
};
|
||||
|
@ -109,8 +107,6 @@ struct receive_sc {
|
|||
|
||||
struct os_time created_time; /* Time createdTime */
|
||||
|
||||
unsigned int channel;
|
||||
|
||||
struct dl_list list;
|
||||
struct dl_list sa_list;
|
||||
};
|
||||
|
@ -146,7 +142,6 @@ struct ieee802_1x_kay_ctx {
|
|||
int (*get_receive_lowest_pn)(void *ctx, struct receive_sa *sa);
|
||||
int (*get_transmit_next_pn)(void *ctx, struct transmit_sa *sa);
|
||||
int (*set_transmit_next_pn)(void *ctx, struct transmit_sa *sa);
|
||||
int (*get_available_receive_sc)(void *ctx, u32 *channel);
|
||||
int (*create_receive_sc)(void *ctx, struct receive_sc *sc,
|
||||
enum validate_frames vf,
|
||||
enum confidentiality_offset co);
|
||||
|
@ -154,7 +149,6 @@ struct ieee802_1x_kay_ctx {
|
|||
int (*create_receive_sa)(void *ctx, struct receive_sa *sa);
|
||||
int (*enable_receive_sa)(void *ctx, struct receive_sa *sa);
|
||||
int (*disable_receive_sa)(void *ctx, struct receive_sa *sa);
|
||||
int (*get_available_transmit_sc)(void *ctx, u32 *channel);
|
||||
int (*create_transmit_sc)(void *ctx, struct transmit_sc *sc,
|
||||
enum confidentiality_offset co);
|
||||
int (*delete_transmit_sc)(void *ctx, struct transmit_sc *sc);
|
||||
|
@ -209,7 +203,6 @@ struct ieee802_1x_kay {
|
|||
|
||||
u8 mka_version;
|
||||
u8 algo_agility[4];
|
||||
u32 sc_ch;
|
||||
|
||||
u32 pn_exhaustion;
|
||||
Boolean port_enable;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue