Changeset 21969


Ignore:
Timestamp:
2010-06-27T16:37:34+02:00 (6 years ago)
Author:
juhosg
Message:

generic: rtl8366rb: fix MIB counter reset

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/generic/files/drivers/net/phy/rtl8366rb.c

    r21952 r21969  
    9292#define RTL8366S_MIB_CTRL_REG               0x13F0 
    9393#define RTL8366S_MIB_CTRL_USER_MASK         0x0FFC 
    94 #define RTL8366S_MIB_CTRL_BUSY_MASK         0x0001 
    95 #define RTL8366S_MIB_CTRL_RESET_MASK        0x0001 
    96  
    97 #define RTL8366S_MIB_CTRL_GLOBAL_RESET_MASK 0x0004 
    98 #define RTL8366S_MIB_CTRL_PORT_RESET_BIT    0x0003 
    99 #define RTL8366S_MIB_CTRL_PORT_RESET_MASK   0x01FC 
    100  
     94#define RTL8366S_MIB_CTRL_BUSY_MASK         BIT(0) 
     95#define RTL8366S_MIB_CTRL_RESET_MASK        BIT(1) 
     96#define RTL8366S_MIB_CTRL_PORT_RESET(_p)    BIT(2 + (_p)) 
     97#define RTL8366S_MIB_CTRL_GLOBAL_RESET      BIT(11) 
    10198 
    10299#define RTL8366S_PORT_VLAN_CTRL_BASE        0x0063 
     
    11081105 
    11091106        if (val->value.i == 1) 
    1110                 err = rtl8366_smi_rmwr(smi, RTL8366S_MIB_CTRL_REG, 0, (1 << 2)); 
     1107                err = rtl8366_smi_rmwr(smi, RTL8366S_MIB_CTRL_REG, 0, 
     1108                                       RTL8366S_MIB_CTRL_GLOBAL_RESET); 
    11111109 
    11121110        return err; 
     
    13281326                return -EINVAL; 
    13291327 
    1330         return rtl8366_smi_rmwr(smi, RTL8366S_MIB_CTRL_REG, 
    1331                                 0, (1 << (val->port_vlan + 3))); 
     1328        return rtl8366_smi_rmwr(smi, RTL8366S_MIB_CTRL_REG, 0, 
     1329                                RTL8366S_MIB_CTRL_PORT_RESET(val->port_vlan)); 
    13321330} 
    13331331 
Note: See TracChangeset for help on using the changeset viewer.