.. | .. |
---|
1 | 1 | /* |
---|
2 | | - * Marvell Wireless LAN device driver: station command handling |
---|
| 2 | + * NXP Wireless LAN device driver: station command handling |
---|
3 | 3 | * |
---|
4 | | - * Copyright (C) 2011-2014, Marvell International Ltd. |
---|
| 4 | + * Copyright 2011-2020 NXP |
---|
5 | 5 | * |
---|
6 | | - * This software file (the "File") is distributed by Marvell International |
---|
7 | | - * Ltd. under the terms of the GNU General Public License Version 2, June 1991 |
---|
| 6 | + * This software file (the "File") is distributed by NXP |
---|
| 7 | + * under the terms of the GNU General Public License Version 2, June 1991 |
---|
8 | 8 | * (the "License"). You may use, redistribute and/or modify this File in |
---|
9 | 9 | * accordance with the terms and conditions of the License, a copy of which |
---|
10 | 10 | * is available by writing to the Free Software Foundation, Inc., |
---|
.. | .. |
---|
853 | 853 | memset(&key_material->key_param_set, 0, |
---|
854 | 854 | sizeof(struct mwifiex_ie_type_key_param_set)); |
---|
855 | 855 | if (enc_key->is_wapi_key) { |
---|
856 | | - mwifiex_dbg(priv->adapter, INFO, "info: Set WAPI Key\n"); |
---|
857 | | - key_material->key_param_set.key_type_id = |
---|
858 | | - cpu_to_le16(KEY_TYPE_ID_WAPI); |
---|
859 | | - if (cmd_oid == KEY_INFO_ENABLED) |
---|
860 | | - key_material->key_param_set.key_info = |
---|
861 | | - cpu_to_le16(KEY_ENABLED); |
---|
862 | | - else |
---|
863 | | - key_material->key_param_set.key_info = |
---|
864 | | - cpu_to_le16(!KEY_ENABLED); |
---|
| 856 | + struct mwifiex_ie_type_key_param_set *set; |
---|
865 | 857 | |
---|
866 | | - key_material->key_param_set.key[0] = enc_key->key_index; |
---|
| 858 | + mwifiex_dbg(priv->adapter, INFO, "info: Set WAPI Key\n"); |
---|
| 859 | + set = &key_material->key_param_set; |
---|
| 860 | + set->key_type_id = cpu_to_le16(KEY_TYPE_ID_WAPI); |
---|
| 861 | + if (cmd_oid == KEY_INFO_ENABLED) |
---|
| 862 | + set->key_info = cpu_to_le16(KEY_ENABLED); |
---|
| 863 | + else |
---|
| 864 | + set->key_info = cpu_to_le16(!KEY_ENABLED); |
---|
| 865 | + |
---|
| 866 | + set->key[0] = enc_key->key_index; |
---|
867 | 867 | if (!priv->sec_info.wapi_key_on) |
---|
868 | | - key_material->key_param_set.key[1] = 1; |
---|
| 868 | + set->key[1] = 1; |
---|
869 | 869 | else |
---|
870 | 870 | /* set 0 when re-key */ |
---|
871 | | - key_material->key_param_set.key[1] = 0; |
---|
| 871 | + set->key[1] = 0; |
---|
872 | 872 | |
---|
873 | 873 | if (!is_broadcast_ether_addr(enc_key->mac_addr)) { |
---|
874 | 874 | /* WAPI pairwise key: unicast */ |
---|
875 | | - key_material->key_param_set.key_info |= |
---|
876 | | - cpu_to_le16(KEY_UNICAST); |
---|
| 875 | + set->key_info |= cpu_to_le16(KEY_UNICAST); |
---|
877 | 876 | } else { /* WAPI group key: multicast */ |
---|
878 | | - key_material->key_param_set.key_info |= |
---|
879 | | - cpu_to_le16(KEY_MCAST); |
---|
| 877 | + set->key_info |= cpu_to_le16(KEY_MCAST); |
---|
880 | 878 | priv->sec_info.wapi_key_on = true; |
---|
881 | 879 | } |
---|
882 | 880 | |
---|
883 | | - key_material->key_param_set.type = |
---|
884 | | - cpu_to_le16(TLV_TYPE_KEY_MATERIAL); |
---|
885 | | - key_material->key_param_set.key_len = |
---|
886 | | - cpu_to_le16(WAPI_KEY_LEN); |
---|
887 | | - memcpy(&key_material->key_param_set.key[2], |
---|
888 | | - enc_key->key_material, enc_key->key_len); |
---|
889 | | - memcpy(&key_material->key_param_set.key[2 + enc_key->key_len], |
---|
890 | | - enc_key->pn, PN_LEN); |
---|
891 | | - key_material->key_param_set.length = |
---|
892 | | - cpu_to_le16(WAPI_KEY_LEN + KEYPARAMSET_FIXED_LEN); |
---|
| 881 | + set->type = cpu_to_le16(TLV_TYPE_KEY_MATERIAL); |
---|
| 882 | + set->key_len = cpu_to_le16(WAPI_KEY_LEN); |
---|
| 883 | + memcpy(&set->key[2], enc_key->key_material, enc_key->key_len); |
---|
| 884 | + memcpy(&set->key[2 + enc_key->key_len], enc_key->pn, PN_LEN); |
---|
| 885 | + set->length = cpu_to_le16(WAPI_KEY_LEN + KEYPARAMSET_FIXED_LEN); |
---|
893 | 886 | |
---|
894 | 887 | key_param_len = (WAPI_KEY_LEN + KEYPARAMSET_FIXED_LEN) + |
---|
895 | 888 | sizeof(struct mwifiex_ie_types_header); |
---|
.. | .. |
---|
1730 | 1723 | default: |
---|
1731 | 1724 | mwifiex_dbg(priv->adapter, ERROR, |
---|
1732 | 1725 | "Unknown TDLS configuration\n"); |
---|
1733 | | - return -ENOTSUPP; |
---|
| 1726 | + return -EOPNOTSUPP; |
---|
1734 | 1727 | } |
---|
1735 | 1728 | |
---|
1736 | 1729 | le16_unaligned_add_cpu(&cmd->size, len); |
---|
.. | .. |
---|
1856 | 1849 | break; |
---|
1857 | 1850 | default: |
---|
1858 | 1851 | mwifiex_dbg(priv->adapter, ERROR, "Unknown TDLS operation\n"); |
---|
1859 | | - return -ENOTSUPP; |
---|
| 1852 | + return -EOPNOTSUPP; |
---|
1860 | 1853 | } |
---|
1861 | 1854 | |
---|
1862 | 1855 | le16_unaligned_add_cpu(&cmd->size, config_len); |
---|