配置pcie网卡指示灯

pcie网卡原理图,led0 管脚配成 act(闪),led3配置link 1000M

QQ截图未命名

100000000001000  = 0x4008

QQ截图未命名

//lzm: 2011/8/6
/*
pcie网卡原理图,led0 管脚配成 act(闪),led3配置link 1000M

100000000001000  = 0x4008
*/
static void rtl8168_customized_leds(struct rtl8168_private *tp)
{
    void __iomem *ioaddr = tp->mmio_addr;
    printk("-----__LINE__: %d, __FUNCTION__:%s------\n",__LINE__,  __FUNCTION__);
    //disable reg protection
    RTL_W8(Cfg9346, Cfg9346_Unlock);
    if(!(RTL_R8(Config4)&0x40))
    {
    //enable customized leds
        RTL_W8(Config4, RTL_R8(Config4) | 0x40);
    }
    RTL_W16(CustomLED, 0x4008);

    //disable customized leds
    RTL_W8(Config3, RTL_R8(Config3) & ~0x40);
        //enable reg protection
    RTL_W8(Cfg9346, Cfg9346_Lock);   
}

原文地址:https://www.cnblogs.com/cute/p/2129506.html