Merge tag 'metag-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan...
[cascardo/linux.git] / drivers / staging / rtl8192u / ieee80211 / dot11d.c
index 31bded1..90ace79 100644 (file)
@@ -2,8 +2,7 @@
 
 #include "dot11d.h"
 
-void
-Dot11d_Init(struct ieee80211_device *ieee)
+void Dot11d_Init(struct ieee80211_device *ieee)
 {
        PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee);
 
@@ -15,12 +14,12 @@ Dot11d_Init(struct ieee80211_device *ieee)
        memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
        RESET_CIE_WATCHDOG(ieee);
 
-       printk("Dot11d_Init()\n");
+       netdev_info(ieee->dev, "Dot11d_Init()\n");
 }
+EXPORT_SYMBOL(Dot11d_Init);
 
 /* Reset to the state as we are just entering a regulatory domain. */
-void
-Dot11d_Reset(struct ieee80211_device *ieee)
+void Dot11d_Reset(struct ieee80211_device *ieee)
 {
        u32 i;
        PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee);
@@ -38,6 +37,7 @@ Dot11d_Reset(struct ieee80211_device *ieee)
        pDot11dInfo->CountryIeLen = 0;
        RESET_CIE_WATCHDOG(ieee);
 }
+EXPORT_SYMBOL(Dot11d_Reset);
 
 /*
  * Update country IE from Beacon or Probe Resopnse and configure PHY for
@@ -48,13 +48,8 @@ Dot11d_Reset(struct ieee80211_device *ieee)
  * 1. IS_DOT11D_ENABLE() is TRUE.
  * 2. Input IE is an valid one.
  */
-void
-Dot11d_UpdateCountryIe(
-       struct ieee80211_device *dev,
-       u8 *pTaddr,
-       u16     CoutryIeLen,
-       u8 *pCoutryIe
-       )
+void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
+                           u16 CoutryIeLen, u8 *pCoutryIe)
 {
        PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
        u8 i, j, NumTriples, MaxChnlNum;
@@ -70,14 +65,14 @@ Dot11d_UpdateCountryIe(
                        /* It is not in a monotonically increasing order, so
                         * stop processing.
                         */
-                       printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n");
+                       netdev_err(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n");
                        return;
                }
                if (MAX_CHANNEL_NUMBER < (pTriple->FirstChnl + pTriple->NumChnls)) {
                        /* It is not a valid set of channel id, so stop
                         * processing.
                         */
-                       printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip it........2\n");
+                       netdev_err(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it........2\n");
                        return;
                }
 
@@ -89,31 +84,27 @@ Dot11d_UpdateCountryIe(
 
                pTriple = (PCHNL_TXPOWER_TRIPLE)((u8 *)pTriple + 3);
        }
-       printk("Channel List:");
-       for(i=1; i<= MAX_CHANNEL_NUMBER; i++)
-               if(pDot11dInfo->channel_map[i] > 0)
-                       printk(" %d", i);
-       printk("\n");
+       netdev_info(dev->dev, "Channel List:");
+       for (i = 1; i <= MAX_CHANNEL_NUMBER; i++)
+               if (pDot11dInfo->channel_map[i] > 0)
+                       netdev_info(dev->dev, " %d", i);
+       netdev_info(dev->dev, "\n");
 
        UPDATE_CIE_SRC(dev, pTaddr);
 
        pDot11dInfo->CountryIeLen = CoutryIeLen;
-       memcpy(pDot11dInfo->CountryIeBuf, pCoutryIe,CoutryIeLen);
+       memcpy(pDot11dInfo->CountryIeBuf, pCoutryIe, CoutryIeLen);
        pDot11dInfo->State = DOT11D_STATE_LEARNED;
 }
+EXPORT_SYMBOL(Dot11d_UpdateCountryIe);
 
-
-u8
-DOT11D_GetMaxTxPwrInDbm(
-       struct ieee80211_device *dev,
-       u8 Channel
-       )
+u8 DOT11D_GetMaxTxPwrInDbm(struct ieee80211_device *dev, u8 Channel)
 {
        PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
        u8 MaxTxPwrInDbm = 255;
 
        if (MAX_CHANNEL_NUMBER < Channel) {
-               printk("DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n");
+               netdev_err(dev->dev, "DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n");
                return MaxTxPwrInDbm;
        }
        if (pDot11dInfo->channel_map[Channel])
@@ -121,12 +112,9 @@ DOT11D_GetMaxTxPwrInDbm(
 
        return MaxTxPwrInDbm;
 }
+EXPORT_SYMBOL(DOT11D_GetMaxTxPwrInDbm);
 
-
-void
-DOT11D_ScanComplete(
-       struct ieee80211_device *dev
-       )
+void DOT11D_ScanComplete(struct ieee80211_device *dev)
 {
        PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
 
@@ -145,27 +133,23 @@ DOT11D_ScanComplete(
                break;
        }
 }
+EXPORT_SYMBOL(DOT11D_ScanComplete);
 
-int IsLegalChannel(
-       struct ieee80211_device *dev,
-       u8 channel
-)
+int IsLegalChannel(struct ieee80211_device *dev, u8 channel)
 {
        PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
 
        if (MAX_CHANNEL_NUMBER < channel) {
-               printk("IsLegalChannel(): Invalid Channel\n");
+               netdev_err(dev->dev, "IsLegalChannel(): Invalid Channel\n");
                return 0;
        }
-       if(pDot11dInfo->channel_map[channel] > 0)
+       if (pDot11dInfo->channel_map[channel] > 0)
                return 1;
        return 0;
 }
+EXPORT_SYMBOL(IsLegalChannel);
 
-int ToLegalChannel(
-       struct ieee80211_device *dev,
-       u8 channel
-)
+int ToLegalChannel(struct ieee80211_device *dev, u8 channel)
 {
        PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
        u8 default_chn = 0;
@@ -179,19 +163,13 @@ int ToLegalChannel(
        }
 
        if (MAX_CHANNEL_NUMBER < channel) {
-               printk("IsLegalChannel(): Invalid Channel\n");
+               netdev_err(dev->dev, "IsLegalChannel(): Invalid Channel\n");
                return default_chn;
        }
 
-       if(pDot11dInfo->channel_map[channel] > 0)
+       if (pDot11dInfo->channel_map[channel] > 0)
                return channel;
 
        return default_chn;
 }
-EXPORT_SYMBOL(Dot11d_Init);
-EXPORT_SYMBOL(Dot11d_Reset);
-EXPORT_SYMBOL(Dot11d_UpdateCountryIe);
-EXPORT_SYMBOL(DOT11D_GetMaxTxPwrInDbm);
-EXPORT_SYMBOL(DOT11D_ScanComplete);
-EXPORT_SYMBOL(IsLegalChannel);
 EXPORT_SYMBOL(ToLegalChannel);