When setting tx power in sysfs, check against max channel tx power
limit instead of IWL_TX_POWER_TARGET_POWER_MAX.
Different devices have different max tx power limit; using
IWL_TX_POWER_TARGET_POWER_MAX can excess the limitaion and give wrong
information.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
                return -EINVAL;
        }
 
-       if (tx_power > IWL_TX_POWER_TARGET_POWER_MAX) {
-               IWL_WARN(priv, "Requested user TXPOWER %d above upper limit %d.\n",
-                        tx_power,
-                        IWL_TX_POWER_TARGET_POWER_MAX);
+       if (tx_power > priv->tx_power_channel_lmt) {
+               IWL_WARN(priv,
+                       "Requested user TXPOWER %d above upper limit %d.\n",
+                        tx_power, priv->tx_power_channel_lmt);
                return -EINVAL;
        }