Lines Matching refs:msg
33 static u8 fill_wep_pair(struct wfx_hif_wep_pairwise_key *msg, in fill_wep_pair() argument
36 WARN(key->keylen > sizeof(msg->key_data), "inconsistent data"); in fill_wep_pair()
37 msg->key_length = key->keylen; in fill_wep_pair()
38 memcpy(msg->key_data, key->key, key->keylen); in fill_wep_pair()
39 ether_addr_copy(msg->peer_address, peer_addr); in fill_wep_pair()
43 static u8 fill_wep_group(struct wfx_hif_wep_group_key *msg, in fill_wep_group() argument
46 WARN(key->keylen > sizeof(msg->key_data), "inconsistent data"); in fill_wep_group()
47 msg->key_id = key->keyidx; in fill_wep_group()
48 msg->key_length = key->keylen; in fill_wep_group()
49 memcpy(msg->key_data, key->key, key->keylen); in fill_wep_group()
53 static u8 fill_tkip_pair(struct wfx_hif_tkip_pairwise_key *msg, in fill_tkip_pair() argument
58 WARN(key->keylen != sizeof(msg->tkip_key_data) + sizeof(msg->tx_mic_key) + in fill_tkip_pair()
59 sizeof(msg->rx_mic_key), "inconsistent data"); in fill_tkip_pair()
60 memcpy(msg->tkip_key_data, keybuf, sizeof(msg->tkip_key_data)); in fill_tkip_pair()
61 keybuf += sizeof(msg->tkip_key_data); in fill_tkip_pair()
62 memcpy(msg->tx_mic_key, keybuf, sizeof(msg->tx_mic_key)); in fill_tkip_pair()
63 keybuf += sizeof(msg->tx_mic_key); in fill_tkip_pair()
64 memcpy(msg->rx_mic_key, keybuf, sizeof(msg->rx_mic_key)); in fill_tkip_pair()
65 ether_addr_copy(msg->peer_address, peer_addr); in fill_tkip_pair()
69 static u8 fill_tkip_group(struct wfx_hif_tkip_group_key *msg, struct ieee80211_key_conf *key, in fill_tkip_group() argument
74 WARN(key->keylen != sizeof(msg->tkip_key_data) + 2 * sizeof(msg->rx_mic_key), in fill_tkip_group()
76 msg->key_id = key->keyidx; in fill_tkip_group()
77 memcpy(msg->rx_sequence_counter, &seq->tkip.iv16, sizeof(seq->tkip.iv16)); in fill_tkip_group()
78 memcpy(msg->rx_sequence_counter + sizeof(u16), &seq->tkip.iv32, sizeof(seq->tkip.iv32)); in fill_tkip_group()
79 memcpy(msg->tkip_key_data, keybuf, sizeof(msg->tkip_key_data)); in fill_tkip_group()
80 keybuf += sizeof(msg->tkip_key_data); in fill_tkip_group()
83 memcpy(msg->rx_mic_key, keybuf + 0, sizeof(msg->rx_mic_key)); in fill_tkip_group()
86 memcpy(msg->rx_mic_key, keybuf + 8, sizeof(msg->rx_mic_key)); in fill_tkip_group()
90 static u8 fill_ccmp_pair(struct wfx_hif_aes_pairwise_key *msg, in fill_ccmp_pair() argument
93 WARN(key->keylen != sizeof(msg->aes_key_data), "inconsistent data"); in fill_ccmp_pair()
94 ether_addr_copy(msg->peer_address, peer_addr); in fill_ccmp_pair()
95 memcpy(msg->aes_key_data, key->key, key->keylen); in fill_ccmp_pair()
99 static u8 fill_ccmp_group(struct wfx_hif_aes_group_key *msg, in fill_ccmp_group() argument
102 WARN(key->keylen != sizeof(msg->aes_key_data), "inconsistent data"); in fill_ccmp_group()
103 memcpy(msg->aes_key_data, key->key, key->keylen); in fill_ccmp_group()
104 memcpy(msg->rx_sequence_counter, seq->ccmp.pn, sizeof(seq->ccmp.pn)); in fill_ccmp_group()
105 memreverse(msg->rx_sequence_counter, sizeof(seq->ccmp.pn)); in fill_ccmp_group()
106 msg->key_id = key->keyidx; in fill_ccmp_group()
110 static u8 fill_sms4_pair(struct wfx_hif_wapi_pairwise_key *msg, in fill_sms4_pair() argument
115 WARN(key->keylen != sizeof(msg->wapi_key_data) + sizeof(msg->mic_key_data), in fill_sms4_pair()
117 ether_addr_copy(msg->peer_address, peer_addr); in fill_sms4_pair()
118 memcpy(msg->wapi_key_data, keybuf, sizeof(msg->wapi_key_data)); in fill_sms4_pair()
119 keybuf += sizeof(msg->wapi_key_data); in fill_sms4_pair()
120 memcpy(msg->mic_key_data, keybuf, sizeof(msg->mic_key_data)); in fill_sms4_pair()
121 msg->key_id = key->keyidx; in fill_sms4_pair()
125 static u8 fill_sms4_group(struct wfx_hif_wapi_group_key *msg, in fill_sms4_group() argument
130 WARN(key->keylen != sizeof(msg->wapi_key_data) + sizeof(msg->mic_key_data), in fill_sms4_group()
132 memcpy(msg->wapi_key_data, keybuf, sizeof(msg->wapi_key_data)); in fill_sms4_group()
133 keybuf += sizeof(msg->wapi_key_data); in fill_sms4_group()
134 memcpy(msg->mic_key_data, keybuf, sizeof(msg->mic_key_data)); in fill_sms4_group()
135 msg->key_id = key->keyidx; in fill_sms4_group()
139 static u8 fill_aes_cmac_group(struct wfx_hif_igtk_group_key *msg, in fill_aes_cmac_group() argument
142 WARN(key->keylen != sizeof(msg->igtk_key_data), "inconsistent data"); in fill_aes_cmac_group()
143 memcpy(msg->igtk_key_data, key->key, key->keylen); in fill_aes_cmac_group()
144 memcpy(msg->ipn, seq->aes_cmac.pn, sizeof(seq->aes_cmac.pn)); in fill_aes_cmac_group()
145 memreverse(msg->ipn, sizeof(seq->aes_cmac.pn)); in fill_aes_cmac_group()
146 msg->key_id = key->keyidx; in fill_aes_cmac_group()