diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-10-21 13:41:45 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-10-22 12:56:38 -0400 |
commit | c6c25ed0bcd8c5d6caf6091e2714b7ccc87316a6 (patch) | |
tree | 14dc0169a45077a8ae0c2c866f9a92a5dbbba309 /drivers/staging | |
parent | b243c4aaf8d470a99101521c9197ed5b38084793 (diff) |
Staging: sxg: fix up unused function warnings
These functions aren't used yet, so put them behind the
proper #define so the compiler doesn't complain about them.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/sxg/sxg.c | 155 |
1 files changed, 78 insertions, 77 deletions
diff --git a/drivers/staging/sxg/sxg.c b/drivers/staging/sxg/sxg.c index 3b05acf35d8..fe935e23685 100644 --- a/drivers/staging/sxg/sxg.c +++ b/drivers/staging/sxg/sxg.c | |||
@@ -112,12 +112,16 @@ static bool sxg_mac_filter(p_adapter_t adapter, | |||
112 | static struct net_device_stats *sxg_get_stats(p_net_device dev); | 112 | static struct net_device_stats *sxg_get_stats(p_net_device dev); |
113 | #endif | 113 | #endif |
114 | 114 | ||
115 | #define XXXTODO 0 | ||
116 | |||
117 | #if XXXTODO | ||
115 | static int sxg_mac_set_address(p_net_device dev, void *ptr); | 118 | static int sxg_mac_set_address(p_net_device dev, void *ptr); |
119 | static void sxg_mcast_set_list(p_net_device dev); | ||
120 | #endif | ||
116 | 121 | ||
117 | static void sxg_adapter_set_hwaddr(p_adapter_t adapter); | 122 | static void sxg_adapter_set_hwaddr(p_adapter_t adapter); |
118 | 123 | ||
119 | static void sxg_unmap_mmio_space(p_adapter_t adapter); | 124 | static void sxg_unmap_mmio_space(p_adapter_t adapter); |
120 | static void sxg_mcast_set_mask(p_adapter_t adapter); | ||
121 | 125 | ||
122 | static int sxg_initialize_adapter(p_adapter_t adapter); | 126 | static int sxg_initialize_adapter(p_adapter_t adapter); |
123 | static void sxg_stock_rcv_buffers(p_adapter_t adapter); | 127 | static void sxg_stock_rcv_buffers(p_adapter_t adapter); |
@@ -132,9 +136,6 @@ static int sxg_write_mdio_reg(p_adapter_t adapter, | |||
132 | u32 DevAddr, u32 RegAddr, u32 Value); | 136 | u32 DevAddr, u32 RegAddr, u32 Value); |
133 | static int sxg_read_mdio_reg(p_adapter_t adapter, | 137 | static int sxg_read_mdio_reg(p_adapter_t adapter, |
134 | u32 DevAddr, u32 RegAddr, u32 *pValue); | 138 | u32 DevAddr, u32 RegAddr, u32 *pValue); |
135 | static void sxg_mcast_set_list(p_net_device dev); | ||
136 | |||
137 | #define XXXTODO 0 | ||
138 | 139 | ||
139 | static unsigned int sxg_first_init = 1; | 140 | static unsigned int sxg_first_init = 1; |
140 | static char *sxg_banner = | 141 | static char *sxg_banner = |
@@ -2668,38 +2669,6 @@ static int sxg_read_mdio_reg(p_adapter_t adapter, | |||
2668 | } | 2669 | } |
2669 | 2670 | ||
2670 | /* | 2671 | /* |
2671 | * Allocate a mcast_address structure to hold the multicast address. | ||
2672 | * Link it in. | ||
2673 | */ | ||
2674 | static int sxg_mcast_add_list(p_adapter_t adapter, char *address) | ||
2675 | { | ||
2676 | p_mcast_address_t mcaddr, mlist; | ||
2677 | bool equaladdr; | ||
2678 | |||
2679 | /* Check to see if it already exists */ | ||
2680 | mlist = adapter->mcastaddrs; | ||
2681 | while (mlist) { | ||
2682 | ETHER_EQ_ADDR(mlist->address, address, equaladdr); | ||
2683 | if (equaladdr) { | ||
2684 | return (STATUS_SUCCESS); | ||
2685 | } | ||
2686 | mlist = mlist->next; | ||
2687 | } | ||
2688 | |||
2689 | /* Doesn't already exist. Allocate a structure to hold it */ | ||
2690 | mcaddr = kmalloc(sizeof(mcast_address_t), GFP_ATOMIC); | ||
2691 | if (mcaddr == NULL) | ||
2692 | return 1; | ||
2693 | |||
2694 | memcpy(mcaddr->address, address, 6); | ||
2695 | |||
2696 | mcaddr->next = adapter->mcastaddrs; | ||
2697 | adapter->mcastaddrs = mcaddr; | ||
2698 | |||
2699 | return (STATUS_SUCCESS); | ||
2700 | } | ||
2701 | |||
2702 | /* | ||
2703 | * Functions to obtain the CRC corresponding to the destination mac address. | 2672 | * Functions to obtain the CRC corresponding to the destination mac address. |
2704 | * This is a standard ethernet CRC in that it is a 32-bit, reflected CRC using | 2673 | * This is a standard ethernet CRC in that it is a 32-bit, reflected CRC using |
2705 | * the polynomial: | 2674 | * the polynomial: |
@@ -2710,7 +2679,6 @@ static int sxg_mcast_add_list(p_adapter_t adapter, char *address) | |||
2710 | * | 2679 | * |
2711 | */ | 2680 | */ |
2712 | static u32 sxg_crc_table[256]; /* Table of CRC's for all possible byte values */ | 2681 | static u32 sxg_crc_table[256]; /* Table of CRC's for all possible byte values */ |
2713 | static u32 sxg_crc_init; /* Is table initialized */ | ||
2714 | 2682 | ||
2715 | /* | 2683 | /* |
2716 | * Contruct the CRC32 table | 2684 | * Contruct the CRC32 table |
@@ -2737,6 +2705,8 @@ static void sxg_mcast_init_crc32(void) | |||
2737 | } | 2705 | } |
2738 | } | 2706 | } |
2739 | 2707 | ||
2708 | #if XXXTODO | ||
2709 | static u32 sxg_crc_init; /* Is table initialized */ | ||
2740 | /* | 2710 | /* |
2741 | * Return the MAC hast as described above. | 2711 | * Return the MAC hast as described above. |
2742 | */ | 2712 | */ |
@@ -2765,6 +2735,74 @@ static unsigned char sxg_mcast_get_mac_hash(char *macaddr) | |||
2765 | return (machash); | 2735 | return (machash); |
2766 | } | 2736 | } |
2767 | 2737 | ||
2738 | static void sxg_mcast_set_mask(p_adapter_t adapter) | ||
2739 | { | ||
2740 | PSXG_UCODE_REGS sxg_regs = adapter->UcodeRegs; | ||
2741 | |||
2742 | DBG_ERROR("%s ENTER (%s) macopts[%x] mask[%llx]\n", __func__, | ||
2743 | adapter->netdev->name, (unsigned int)adapter->MacFilter, | ||
2744 | adapter->MulticastMask); | ||
2745 | |||
2746 | if (adapter->MacFilter & (MAC_ALLMCAST | MAC_PROMISC)) { | ||
2747 | /* Turn on all multicast addresses. We have to do this for promiscuous | ||
2748 | * mode as well as ALLMCAST mode. It saves the Microcode from having | ||
2749 | * to keep state about the MAC configuration. | ||
2750 | */ | ||
2751 | /* DBG_ERROR("sxg: %s macopts = MAC_ALLMCAST | MAC_PROMISC\n SLUT MODE!!!\n",__func__); */ | ||
2752 | WRITE_REG(sxg_regs->McastLow, 0xFFFFFFFF, FLUSH); | ||
2753 | WRITE_REG(sxg_regs->McastHigh, 0xFFFFFFFF, FLUSH); | ||
2754 | /* DBG_ERROR("%s (%s) WRITE to slic_regs slic_mcastlow&high 0xFFFFFFFF\n",__func__, adapter->netdev->name); */ | ||
2755 | |||
2756 | } else { | ||
2757 | /* Commit our multicast mast to the SLIC by writing to the multicast | ||
2758 | * address mask registers | ||
2759 | */ | ||
2760 | DBG_ERROR("%s (%s) WRITE mcastlow[%lx] mcasthigh[%lx]\n", | ||
2761 | __func__, adapter->netdev->name, | ||
2762 | ((ulong) (adapter->MulticastMask & 0xFFFFFFFF)), | ||
2763 | ((ulong) | ||
2764 | ((adapter->MulticastMask >> 32) & 0xFFFFFFFF))); | ||
2765 | |||
2766 | WRITE_REG(sxg_regs->McastLow, | ||
2767 | (u32) (adapter->MulticastMask & 0xFFFFFFFF), FLUSH); | ||
2768 | WRITE_REG(sxg_regs->McastHigh, | ||
2769 | (u32) ((adapter-> | ||
2770 | MulticastMask >> 32) & 0xFFFFFFFF), FLUSH); | ||
2771 | } | ||
2772 | } | ||
2773 | |||
2774 | /* | ||
2775 | * Allocate a mcast_address structure to hold the multicast address. | ||
2776 | * Link it in. | ||
2777 | */ | ||
2778 | static int sxg_mcast_add_list(p_adapter_t adapter, char *address) | ||
2779 | { | ||
2780 | p_mcast_address_t mcaddr, mlist; | ||
2781 | bool equaladdr; | ||
2782 | |||
2783 | /* Check to see if it already exists */ | ||
2784 | mlist = adapter->mcastaddrs; | ||
2785 | while (mlist) { | ||
2786 | ETHER_EQ_ADDR(mlist->address, address, equaladdr); | ||
2787 | if (equaladdr) { | ||
2788 | return (STATUS_SUCCESS); | ||
2789 | } | ||
2790 | mlist = mlist->next; | ||
2791 | } | ||
2792 | |||
2793 | /* Doesn't already exist. Allocate a structure to hold it */ | ||
2794 | mcaddr = kmalloc(sizeof(mcast_address_t), GFP_ATOMIC); | ||
2795 | if (mcaddr == NULL) | ||
2796 | return 1; | ||
2797 | |||
2798 | memcpy(mcaddr->address, address, 6); | ||
2799 | |||
2800 | mcaddr->next = adapter->mcastaddrs; | ||
2801 | adapter->mcastaddrs = mcaddr; | ||
2802 | |||
2803 | return (STATUS_SUCCESS); | ||
2804 | } | ||
2805 | |||
2768 | static void sxg_mcast_set_bit(p_adapter_t adapter, char *address) | 2806 | static void sxg_mcast_set_bit(p_adapter_t adapter, char *address) |
2769 | { | 2807 | { |
2770 | unsigned char crcpoly; | 2808 | unsigned char crcpoly; |
@@ -2783,7 +2821,6 @@ static void sxg_mcast_set_bit(p_adapter_t adapter, char *address) | |||
2783 | 2821 | ||
2784 | static void sxg_mcast_set_list(p_net_device dev) | 2822 | static void sxg_mcast_set_list(p_net_device dev) |
2785 | { | 2823 | { |
2786 | #if XXXTODO | ||
2787 | p_adapter_t adapter = (p_adapter_t) netdev_priv(dev); | 2824 | p_adapter_t adapter = (p_adapter_t) netdev_priv(dev); |
2788 | int status = STATUS_SUCCESS; | 2825 | int status = STATUS_SUCCESS; |
2789 | int i; | 2826 | int i; |
@@ -2835,45 +2872,9 @@ static void sxg_mcast_set_list(p_net_device dev) | |||
2835 | sxg_mcast_set_mask(adapter); | 2872 | sxg_mcast_set_mask(adapter); |
2836 | } | 2873 | } |
2837 | } | 2874 | } |
2838 | #endif | ||
2839 | return; | 2875 | return; |
2840 | } | 2876 | } |
2841 | 2877 | #endif | |
2842 | static void sxg_mcast_set_mask(p_adapter_t adapter) | ||
2843 | { | ||
2844 | PSXG_UCODE_REGS sxg_regs = adapter->UcodeRegs; | ||
2845 | |||
2846 | DBG_ERROR("%s ENTER (%s) macopts[%x] mask[%llx]\n", __func__, | ||
2847 | adapter->netdev->name, (unsigned int)adapter->MacFilter, | ||
2848 | adapter->MulticastMask); | ||
2849 | |||
2850 | if (adapter->MacFilter & (MAC_ALLMCAST | MAC_PROMISC)) { | ||
2851 | /* Turn on all multicast addresses. We have to do this for promiscuous | ||
2852 | * mode as well as ALLMCAST mode. It saves the Microcode from having | ||
2853 | * to keep state about the MAC configuration. | ||
2854 | */ | ||
2855 | /* DBG_ERROR("sxg: %s macopts = MAC_ALLMCAST | MAC_PROMISC\n SLUT MODE!!!\n",__func__); */ | ||
2856 | WRITE_REG(sxg_regs->McastLow, 0xFFFFFFFF, FLUSH); | ||
2857 | WRITE_REG(sxg_regs->McastHigh, 0xFFFFFFFF, FLUSH); | ||
2858 | /* DBG_ERROR("%s (%s) WRITE to slic_regs slic_mcastlow&high 0xFFFFFFFF\n",__func__, adapter->netdev->name); */ | ||
2859 | |||
2860 | } else { | ||
2861 | /* Commit our multicast mast to the SLIC by writing to the multicast | ||
2862 | * address mask registers | ||
2863 | */ | ||
2864 | DBG_ERROR("%s (%s) WRITE mcastlow[%lx] mcasthigh[%lx]\n", | ||
2865 | __func__, adapter->netdev->name, | ||
2866 | ((ulong) (adapter->MulticastMask & 0xFFFFFFFF)), | ||
2867 | ((ulong) | ||
2868 | ((adapter->MulticastMask >> 32) & 0xFFFFFFFF))); | ||
2869 | |||
2870 | WRITE_REG(sxg_regs->McastLow, | ||
2871 | (u32) (adapter->MulticastMask & 0xFFFFFFFF), FLUSH); | ||
2872 | WRITE_REG(sxg_regs->McastHigh, | ||
2873 | (u32) ((adapter-> | ||
2874 | MulticastMask >> 32) & 0xFFFFFFFF), FLUSH); | ||
2875 | } | ||
2876 | } | ||
2877 | 2878 | ||
2878 | static void sxg_unmap_mmio_space(p_adapter_t adapter) | 2879 | static void sxg_unmap_mmio_space(p_adapter_t adapter) |
2879 | { | 2880 | { |
@@ -3267,9 +3268,9 @@ static void sxg_adapter_set_hwaddr(p_adapter_t adapter) | |||
3267 | 3268 | ||
3268 | } | 3269 | } |
3269 | 3270 | ||
3271 | #if XXXTODO | ||
3270 | static int sxg_mac_set_address(p_net_device dev, void *ptr) | 3272 | static int sxg_mac_set_address(p_net_device dev, void *ptr) |
3271 | { | 3273 | { |
3272 | #if XXXTODO | ||
3273 | p_adapter_t adapter = (p_adapter_t) netdev_priv(dev); | 3274 | p_adapter_t adapter = (p_adapter_t) netdev_priv(dev); |
3274 | struct sockaddr *addr = ptr; | 3275 | struct sockaddr *addr = ptr; |
3275 | 3276 | ||
@@ -3295,9 +3296,9 @@ static int sxg_mac_set_address(p_net_device dev, void *ptr) | |||
3295 | adapter->currmacaddr[5]); | 3296 | adapter->currmacaddr[5]); |
3296 | 3297 | ||
3297 | sxg_config_set(adapter, TRUE); | 3298 | sxg_config_set(adapter, TRUE); |
3298 | #endif | ||
3299 | return 0; | 3299 | return 0; |
3300 | } | 3300 | } |
3301 | #endif | ||
3301 | 3302 | ||
3302 | /*****************************************************************************/ | 3303 | /*****************************************************************************/ |
3303 | /************* SXG DRIVER FUNCTIONS (below) ********************************/ | 3304 | /************* SXG DRIVER FUNCTIONS (below) ********************************/ |