From 408bd7b7b244c23a78deb41cadbeb070c794da94 Mon Sep 17 00:00:00 2001 From: Mateusz Kulikowski Date: Sun, 19 Jul 2015 19:28:03 +0200 Subject: [PATCH] staging: rtl8192e: Rename setKey Use naming schema found in other rtlwifi devices. Rename setKey to rtl92e_set_key. Signed-off-by: Mateusz Kulikowski Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 84 ++++++++++---------- drivers/staging/rtl8192e/rtl8192e/rtl_cam.h | 5 +- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 26 +++--- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 13 +-- 4 files changed, 68 insertions(+), 60 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c index 39640dda4acf..8e4da40793bd 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c @@ -87,8 +87,9 @@ void set_swcam(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, } } -void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, - const u8 *MacAddr, u8 DefaultKey, u32 *KeyContent) +void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex, + u16 KeyType, const u8 *MacAddr, u8 DefaultKey, + u32 *KeyContent) { u32 TargetCommand = 0; u32 TargetContent = 0; @@ -115,7 +116,7 @@ void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, netdev_info(dev, "%s(): Invalid CAM entry\n", __func__); RT_TRACE(COMP_SEC, - "====>to setKey(), dev:%p, EntryNo:%d, KeyIndex:%d,KeyType:%d, MacAddr %pM\n", + "====>to rtl92e_set_key(), dev:%p, EntryNo:%d, KeyIndex:%d,KeyType:%d, MacAddr %pM\n", dev, EntryNo, KeyIndex, KeyType, MacAddr); if (DefaultKey) @@ -179,36 +180,41 @@ void rtl92e_cam_restore(struct net_device *dev) for (EntryId = 0; EntryId < 4; EntryId++) { MacAddr = CAM_CONST_ADDR[EntryId]; if (priv->rtllib->swcamtable[EntryId].bused) { - setKey(dev, EntryId, EntryId, - priv->rtllib->pairwise_key_type, MacAddr, - 0, (u32 *)(&priv->rtllib->swcamtable - [EntryId].key_buf[0])); + rtl92e_set_key(dev, EntryId, EntryId, + priv->rtllib->pairwise_key_type, + MacAddr, 0, + (u32 *)(&priv->rtllib->swcamtable + [EntryId].key_buf[0])); } } } else if (priv->rtllib->pairwise_key_type == KEY_TYPE_TKIP) { if (priv->rtllib->iw_mode == IW_MODE_ADHOC) { - setKey(dev, 4, 0, priv->rtllib->pairwise_key_type, - (u8 *)dev->dev_addr, 0, - (u32 *)(&priv->rtllib->swcamtable[4].key_buf[0])); + rtl92e_set_key(dev, 4, 0, + priv->rtllib->pairwise_key_type, + (u8 *)dev->dev_addr, 0, + (u32 *)(&priv->rtllib->swcamtable[4]. + key_buf[0])); } else { - setKey(dev, 4, 0, priv->rtllib->pairwise_key_type, - MacAddr, 0, - (u32 *)(&priv->rtllib->swcamtable[4].key_buf[0])); + rtl92e_set_key(dev, 4, 0, + priv->rtllib->pairwise_key_type, + MacAddr, 0, + (u32 *)(&priv->rtllib->swcamtable[4]. + key_buf[0])); } } else if (priv->rtllib->pairwise_key_type == KEY_TYPE_CCMP) { if (priv->rtllib->iw_mode == IW_MODE_ADHOC) { - setKey(dev, 4, 0, - priv->rtllib->pairwise_key_type, - (u8 *)dev->dev_addr, 0, - (u32 *)(&priv->rtllib->swcamtable[4]. - key_buf[0])); + rtl92e_set_key(dev, 4, 0, + priv->rtllib->pairwise_key_type, + (u8 *)dev->dev_addr, 0, + (u32 *)(&priv->rtllib->swcamtable[4]. + key_buf[0])); } else { - setKey(dev, 4, 0, - priv->rtllib->pairwise_key_type, MacAddr, - 0, (u32 *)(&priv->rtllib->swcamtable[4]. - key_buf[0])); + rtl92e_set_key(dev, 4, 0, + priv->rtllib->pairwise_key_type, MacAddr, + 0, (u32 *)(&priv->rtllib->swcamtable[4]. + key_buf[0])); } } @@ -216,20 +222,18 @@ void rtl92e_cam_restore(struct net_device *dev) MacAddr = CAM_CONST_BROAD; for (EntryId = 1; EntryId < 4; EntryId++) { if (priv->rtllib->swcamtable[EntryId].bused) { - setKey(dev, EntryId, EntryId, - priv->rtllib->group_key_type, - MacAddr, 0, - (u32 *)(&priv->rtllib->swcamtable[EntryId].key_buf[0]) - ); + rtl92e_set_key(dev, EntryId, EntryId, + priv->rtllib->group_key_type, + MacAddr, 0, + (u32 *)(&priv->rtllib->swcamtable[EntryId].key_buf[0])); } } if (priv->rtllib->iw_mode == IW_MODE_ADHOC) { if (priv->rtllib->swcamtable[0].bused) { - setKey(dev, 0, 0, - priv->rtllib->group_key_type, - CAM_CONST_ADDR[0], 0, - (u32 *)(&priv->rtllib->swcamtable[0].key_buf[0]) - ); + rtl92e_set_key(dev, 0, 0, + priv->rtllib->group_key_type, + CAM_CONST_ADDR[0], 0, + (u32 *)(&priv->rtllib->swcamtable[0].key_buf[0])); } else { netdev_warn(dev, "%s(): ADHOC TKIP: missing key entry.\n", @@ -241,19 +245,19 @@ void rtl92e_cam_restore(struct net_device *dev) MacAddr = CAM_CONST_BROAD; for (EntryId = 1; EntryId < 4; EntryId++) { if (priv->rtllib->swcamtable[EntryId].bused) { - setKey(dev, EntryId, EntryId, - priv->rtllib->group_key_type, - MacAddr, 0, - (u32 *)(&priv->rtllib->swcamtable[EntryId].key_buf[0])); + rtl92e_set_key(dev, EntryId, EntryId, + priv->rtllib->group_key_type, + MacAddr, 0, + (u32 *)(&priv->rtllib->swcamtable[EntryId].key_buf[0])); } } if (priv->rtllib->iw_mode == IW_MODE_ADHOC) { if (priv->rtllib->swcamtable[0].bused) { - setKey(dev, 0, 0, - priv->rtllib->group_key_type, - CAM_CONST_ADDR[0], 0, - (u32 *)(&priv->rtllib->swcamtable[0].key_buf[0])); + rtl92e_set_key(dev, 0, 0, + priv->rtllib->group_key_type, + CAM_CONST_ADDR[0], 0, + (u32 *)(&priv->rtllib->swcamtable[0].key_buf[0])); } else { netdev_warn(dev, "%s(): ADHOC CCMP: missing key entry.\n", diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.h b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.h index b0619b77b1f0..a26f3f5254b5 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.h +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.h @@ -30,8 +30,9 @@ struct net_device; void rtl92e_cam_reset(struct net_device *dev); void rtl92e_enable_hw_security_config(struct net_device *dev); -void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, - const u8 *MacAddr, u8 DefaultKey, u32 *KeyContent); +void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex, + u16 KeyType, const u8 *MacAddr, u8 DefaultKey, + u32 *KeyContent); void set_swcam(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, const u8 *MacAddr, u8 DefaultKey, u32 *KeyContent, u8 is_mesh); void rtl92e_cam_restore(struct net_device *dev); diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index df3b846aefa3..00f38ebac190 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -2380,20 +2380,22 @@ static int rtl8192_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ieee->pairwise_key_type, (u8 *)ieee->ap_mac_addr, 0, key, 0); - setKey(dev, 4, ipw->u.crypt.idx, - ieee->pairwise_key_type, - (u8 *)ieee->ap_mac_addr, 0, key); + rtl92e_set_key(dev, 4, ipw->u.crypt.idx, + ieee->pairwise_key_type, + (u8 *)ieee->ap_mac_addr, + 0, key); if (ieee->iw_mode == IW_MODE_ADHOC) { set_swcam(dev, ipw->u.crypt.idx, ipw->u.crypt.idx, ieee->pairwise_key_type, (u8 *)ieee->ap_mac_addr, 0, key, 0); - setKey(dev, ipw->u.crypt.idx, - ipw->u.crypt.idx, - ieee->pairwise_key_type, - (u8 *)ieee->ap_mac_addr, - 0, key); + rtl92e_set_key(dev, + ipw->u.crypt.idx, + ipw->u.crypt.idx, + ieee->pairwise_key_type, + (u8 *)ieee->ap_mac_addr, + 0, key); } } if ((ieee->pairwise_key_type == KEY_TYPE_CCMP) @@ -2422,10 +2424,10 @@ static int rtl8192_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ipw->u.crypt.idx, ieee->group_key_type, broadcast_addr, 0, key, 0); - setKey(dev, ipw->u.crypt.idx, - ipw->u.crypt.idx, - ieee->group_key_type, - broadcast_addr, 0, key); + rtl92e_set_key(dev, ipw->u.crypt.idx, + ipw->u.crypt.idx, + ieee->group_key_type, + broadcast_addr, 0, key); } } } diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index 4795c727bb5b..b2a4bf16d8bc 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -756,8 +756,8 @@ static int r8192_wx_set_enc(struct net_device *dev, else if (wrqu->encoding.length == 0xd) { ieee->pairwise_key_type = KEY_TYPE_WEP104; rtl92e_enable_hw_security_config(dev); - setKey(dev, key_idx, key_idx, KEY_TYPE_WEP104, - zero_addr[key_idx], 0, hwkey); + rtl92e_set_key(dev, key_idx, key_idx, KEY_TYPE_WEP104, + zero_addr[key_idx], 0, hwkey); set_swcam(dev, key_idx, key_idx, KEY_TYPE_WEP104, zero_addr[key_idx], 0, hwkey, 0); } else { @@ -950,19 +950,20 @@ static int r8192_wx_set_enc_ext(struct net_device *dev, if ((alg & KEY_TYPE_WEP40) && (ieee->auth_mode != 2)) { if (ext->key_len == 13) ieee->pairwise_key_type = alg = KEY_TYPE_WEP104; - setKey(dev, idx, idx, alg, zero, 0, key); + rtl92e_set_key(dev, idx, idx, alg, zero, 0, key); set_swcam(dev, idx, idx, alg, zero, 0, key, 0); } else if (group) { ieee->group_key_type = alg; - setKey(dev, idx, idx, alg, broadcast_addr, 0, key); + rtl92e_set_key(dev, idx, idx, alg, broadcast_addr, 0, + key); set_swcam(dev, idx, idx, alg, broadcast_addr, 0, key, 0); } else { if ((ieee->pairwise_key_type == KEY_TYPE_CCMP) && ieee->pHTInfo->bCurrentHTSupport) write_nic_byte(dev, 0x173, 1); - setKey(dev, 4, idx, alg, (u8 *)ieee->ap_mac_addr, - 0, key); + rtl92e_set_key(dev, 4, idx, alg, + (u8 *)ieee->ap_mac_addr, 0, key); set_swcam(dev, 4, idx, alg, (u8 *)ieee->ap_mac_addr, 0, key, 0); } -- 2.34.1