atl1c: threshold for ASPM is changed based on chip capability
authorHuang, Xiong <xiong@qca.qualcomm.com>
Wed, 18 Apr 2012 22:01:21 +0000 (22:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Apr 2012 00:14:19 +0000 (20:14 -0400)
threshold setting to control ASPM for diff chips are different.
currently, all gigabit-capability chips have limited-ASPM under
100M throughput.

Signed-off-by: xiong <xiong@qca.qualcomm.com>
Tested-by: Liu David <dwliu@qca.qualcomm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/atheros/atl1c/atl1c_main.c

index 02754ac130685a855f7161aadd0bc22ba9d32fb5..2e1c9f39ff99864d96ea7fa48844b59043f131bc 100644 (file)
@@ -1080,9 +1080,10 @@ static void atl1c_configure_rx(struct atl1c_adapter *adapter)
        if (hw->ctrl_flags & ATL1C_RX_IPV6_CHKSUM)
                rxq_ctrl_data |= IPV6_CHKSUM_CTRL_EN;
 
-       if (hw->ctrl_flags & ATL1C_ASPM_CTRL_MON)
-               rxq_ctrl_data |= (ASPM_THRUPUT_LIMIT_1M &
-                       ASPM_THRUPUT_LIMIT_MASK) << ASPM_THRUPUT_LIMIT_SHIFT;
+       /* aspm for gigabit */
+       if (hw->nic_type != athr_l1d_2 && (hw->device_id & 1) != 0)
+               rxq_ctrl_data = FIELD_SETX(rxq_ctrl_data, ASPM_THRUPUT_LIMIT,
+                       ASPM_THRUPUT_LIMIT_100M);
 
        AT_WRITE_REG(hw, REG_RXQ_CTRL, rxq_ctrl_data);
 }