提交 d23d1361 编写于 作者: I Igor Mitsyanko 提交者: Kalle Valo

qtnfmac: make encryption info a part of CONNECT command.

Encryption info is a constant part of STA settings, no point
to pass it as an optional TLV.
Remove QTN_TLV_ID_CRYPTO type as it's not used anymore.
Signed-off-by: NIgor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 9766d1dd
...@@ -2037,7 +2037,7 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif, ...@@ -2037,7 +2037,7 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif,
{ {
struct sk_buff *cmd_skb; struct sk_buff *cmd_skb;
struct qlink_cmd_connect *cmd; struct qlink_cmd_connect *cmd;
struct qlink_auth_encr aen; struct qlink_auth_encr *aen;
u16 res_code = QLINK_CMD_RESULT_OK; u16 res_code = QLINK_CMD_RESULT_OK;
int ret; int ret;
int i; int i;
...@@ -2049,8 +2049,6 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif, ...@@ -2049,8 +2049,6 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif,
if (unlikely(!cmd_skb)) if (unlikely(!cmd_skb))
return -ENOMEM; return -ENOMEM;
qtnf_bus_lock(vif->mac->bus);
cmd = (struct qlink_cmd_connect *)cmd_skb->data; cmd = (struct qlink_cmd_connect *)cmd_skb->data;
ether_addr_copy(cmd->bssid, vif->bssid); ether_addr_copy(cmd->bssid, vif->bssid);
...@@ -2077,41 +2075,39 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif, ...@@ -2077,41 +2075,39 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif,
cmd->flags = cpu_to_le32(connect_flags); cmd->flags = cpu_to_le32(connect_flags);
memset(&aen, 0, sizeof(aen)); aen = &cmd->aen;
aen.auth_type = sme->auth_type; aen->auth_type = sme->auth_type;
aen.privacy = !!sme->privacy; aen->privacy = !!sme->privacy;
aen.mfp = sme->mfp; aen->mfp = sme->mfp;
aen.wpa_versions = cpu_to_le32(sme->crypto.wpa_versions); aen->wpa_versions = cpu_to_le32(sme->crypto.wpa_versions);
aen.cipher_group = cpu_to_le32(sme->crypto.cipher_group); aen->cipher_group = cpu_to_le32(sme->crypto.cipher_group);
aen.n_ciphers_pairwise = cpu_to_le32( aen->n_ciphers_pairwise = cpu_to_le32(sme->crypto.n_ciphers_pairwise);
sme->crypto.n_ciphers_pairwise);
for (i = 0; i < QLINK_MAX_NR_CIPHER_SUITES; i++) for (i = 0; i < QLINK_MAX_NR_CIPHER_SUITES; i++)
aen.ciphers_pairwise[i] = cpu_to_le32( aen->ciphers_pairwise[i] =
sme->crypto.ciphers_pairwise[i]); cpu_to_le32(sme->crypto.ciphers_pairwise[i]);
aen.n_akm_suites = cpu_to_le32(sme->crypto.n_akm_suites); aen->n_akm_suites = cpu_to_le32(sme->crypto.n_akm_suites);
for (i = 0; i < QLINK_MAX_NR_AKM_SUITES; i++) for (i = 0; i < QLINK_MAX_NR_AKM_SUITES; i++)
aen.akm_suites[i] = cpu_to_le32( aen->akm_suites[i] = cpu_to_le32(sme->crypto.akm_suites[i]);
sme->crypto.akm_suites[i]);
aen.control_port = sme->crypto.control_port; aen->control_port = sme->crypto.control_port;
aen.control_port_no_encrypt = aen->control_port_no_encrypt =
sme->crypto.control_port_no_encrypt; sme->crypto.control_port_no_encrypt;
aen.control_port_ethertype = cpu_to_le16(be16_to_cpu( aen->control_port_ethertype =
sme->crypto.control_port_ethertype)); cpu_to_le16(be16_to_cpu(sme->crypto.control_port_ethertype));
qtnf_cmd_skb_put_tlv_arr(cmd_skb, WLAN_EID_SSID, sme->ssid, qtnf_cmd_skb_put_tlv_arr(cmd_skb, WLAN_EID_SSID, sme->ssid,
sme->ssid_len); sme->ssid_len);
qtnf_cmd_skb_put_tlv_arr(cmd_skb, QTN_TLV_ID_CRYPTO, (u8 *)&aen,
sizeof(aen));
if (sme->ie_len != 0) if (sme->ie_len != 0)
qtnf_cmd_skb_put_tlv_arr(cmd_skb, QTN_TLV_ID_IE_SET, qtnf_cmd_skb_put_tlv_arr(cmd_skb, QTN_TLV_ID_IE_SET,
sme->ie, sme->ie,
sme->ie_len); sme->ie_len);
qtnf_bus_lock(vif->mac->bus);
ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code); ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code);
if (unlikely(ret)) if (unlikely(ret))
......
...@@ -417,8 +417,9 @@ enum qlink_sta_connect_flags { ...@@ -417,8 +417,9 @@ enum qlink_sta_connect_flags {
* struct qlink_cmd_connect - data for QLINK_CMD_CONNECT command * struct qlink_cmd_connect - data for QLINK_CMD_CONNECT command
* *
* @flags: for future use. * @flags: for future use.
* @freq: center frequence of a channel which should be used to connect. * @channel: channel which should be used to connect.
* @bg_scan_period: period of background scan. * @bg_scan_period: period of background scan.
* @aen: authentication information.
* @bssid: BSSID of the BSS to connect to. * @bssid: BSSID of the BSS to connect to.
* @payload: variable portion of connection request. * @payload: variable portion of connection request.
*/ */
...@@ -427,6 +428,7 @@ struct qlink_cmd_connect { ...@@ -427,6 +428,7 @@ struct qlink_cmd_connect {
__le32 flags; __le32 flags;
__le16 channel; __le16 channel;
__le16 bg_scan_period; __le16 bg_scan_period;
struct qlink_auth_encr aen;
u8 bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
u8 payload[0]; u8 payload[0];
} __packed; } __packed;
...@@ -950,7 +952,6 @@ enum qlink_tlv_id { ...@@ -950,7 +952,6 @@ enum qlink_tlv_id {
QTN_TLV_ID_STA_GENERIC_INFO = 0x0301, QTN_TLV_ID_STA_GENERIC_INFO = 0x0301,
QTN_TLV_ID_KEY = 0x0302, QTN_TLV_ID_KEY = 0x0302,
QTN_TLV_ID_SEQ = 0x0303, QTN_TLV_ID_SEQ = 0x0303,
QTN_TLV_ID_CRYPTO = 0x0304,
QTN_TLV_ID_IE_SET = 0x0305, QTN_TLV_ID_IE_SET = 0x0305,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册