Changeset 31000


Ignore:
Timestamp:
2012-03-18T23:06:23+01:00 (6 years ago)
Author:
juhosg
Message:

generic: ar8216: add init_port field to ar8xxx_chip

File:
1 edited

Legend:

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

    r30999 r31000  
    4141struct ar8xxx_chip { 
    4242        int (*hw_init)(struct ar8216_priv *priv); 
     43        void (*init_port)(struct ar8216_priv *priv, int port); 
    4344        void (*setup_port)(struct ar8216_priv *priv, int port, u32 egress, 
    4445                           u32 ingress, u32 members, u32 pvid); 
     46        int (*atu_flush)(struct ar8216_priv *priv); 
    4547}; 
    4648 
     
    479481        op |= AR8216_VTU_ACTIVE; 
    480482        priv->write(priv, AR8216_REG_VTU, op); 
     483} 
     484 
     485static int 
     486ar8216_atu_flush(struct ar8216_priv *priv) 
     487{ 
     488        int ret; 
     489 
     490        ret = ar8216_wait_bit(priv, AR8216_REG_ATU, AR8216_ATU_ACTIVE, 0); 
     491        if (!ret) 
     492                priv->write(priv, AR8216_REG_ATU, AR8216_ATU_OP_FLUSH); 
     493 
     494        return ret; 
    481495} 
    482496 
     
    744758static const struct ar8xxx_chip ar8216_chip = { 
    745759        .hw_init = ar8216_hw_init, 
     760        .init_port = ar8216_init_port, 
    746761        .setup_port = ar8216_setup_port, 
     762        .atu_flush = ar8216_atu_flush, 
    747763}; 
    748764 
    749765static const struct ar8xxx_chip ar8236_chip = { 
    750766        .hw_init = ar8236_hw_init, 
     767        .init_port = ar8216_init_port, 
    751768        .setup_port = ar8236_setup_port, 
     769        .atu_flush = ar8216_atu_flush, 
    752770}; 
    753771 
    754772static const struct ar8xxx_chip ar8316_chip = { 
    755773        .hw_init = ar8316_hw_init, 
     774        .init_port = ar8216_init_port, 
    756775        .setup_port = ar8216_setup_port, 
     776        .atu_flush = ar8216_atu_flush, 
    757777}; 
    758778 
     
    772792        /* Configure all ports */ 
    773793        for (i = 0; i < AR8216_NUM_PORTS; i++) 
    774                 ar8216_init_port(priv, i); 
     794                priv->chip->init_port(priv, i); 
    775795 
    776796        ar8216_init_globals(priv); 
     
    10131033        /* flush the address translation unit */ 
    10141034        mutex_lock(&priv->reg_mutex); 
    1015         ret = ar8216_wait_bit(priv, AR8216_REG_ATU, AR8216_ATU_ACTIVE, 0); 
    1016         if (!ret) 
    1017                 priv->write(priv, AR8216_REG_ATU, AR8216_ATU_OP_FLUSH); 
     1035        ret = priv->chip->atu_flush(priv); 
    10181036        mutex_unlock(&priv->reg_mutex); 
    10191037 
Note: See TracChangeset for help on using the changeset viewer.