• Andre Guedes's avatar
    igc: Refactor igc_rar_set_index() · 424045be
    Andre Guedes authored
    Current igc_rar_set_index() implementation is a bit convoluted so this
    patch does some code refactoring to improve it.
    
    The helper igc_rar_set_index() is about writing MAC filter settings into
    hardware registers. Logic such as address validation belongs to
    functions upper in the call chain such as igc_set_mac() and
    igc_add_mac_filter(). So this patch moves the is_valid_ether_addr() call
    to igc_add_mac_filter(). No need to touch igc_set_mac() since it already
    checks it.
    
    The variables 'rar_low' and 'rar_high' represent the value in registers
    RAL and RAH so we rename them to 'ral' and 'rah', respectively, to
    match the registers names.
    
    To make it explicit, filter settings are passed as arguments to the
    function instead of reading them from adapter->mac_table "under the
    hood". Also, the function was renamed to igc_set_mac_filter_hw to make
    it more clear what it does.
    
    Finally, the patch removes some wrfl() calls and comments not needed.
    Signed-off-by: default avatarAndre Guedes <andre.guedes@intel.com>
    Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    424045be
igc_main.c 138 KB