/* * Copyright (c) 2005-2008 Chelsio, Inc. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * OpenIB.org BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "common.h" #include "regs.h" /* * # of exact address filters. The first one is used for the station address, * the rest are available for multicast addresses. */ #define EXACT_ADDR_FILTERS … static inline int macidx(const struct cmac *mac) { … } static void xaui_serdes_reset(struct cmac *mac) { … } void t3b_pcs_reset(struct cmac *mac) { … } int t3_mac_reset(struct cmac *mac) { … } static int t3b2_mac_reset(struct cmac *mac) { … } /* * Set the exact match register 'idx' to recognize the given Ethernet address. */ static void set_addr_filter(struct cmac *mac, int idx, const u8 * addr) { … } /* Set one of the station's unicast MAC addresses. */ int t3_mac_set_address(struct cmac *mac, unsigned int idx, const u8 addr[6]) { … } /* * Specify the number of exact address filters that should be reserved for * unicast addresses. Caller should reload the unicast and multicast addresses * after calling this. */ int t3_mac_set_num_ucast(struct cmac *mac, int n) { … } void t3_mac_disable_exact_filters(struct cmac *mac) { … } void t3_mac_enable_exact_filters(struct cmac *mac) { … } /* Calculate the RX hash filter index of an Ethernet address */ static int hash_hw_addr(const u8 * addr) { … } int t3_mac_set_rx_mode(struct cmac *mac, struct net_device *dev) { … } static int rx_fifo_hwm(int mtu) { … } int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu) { … } int t3_mac_set_speed_duplex_fc(struct cmac *mac, int speed, int duplex, int fc) { … } int t3_mac_enable(struct cmac *mac, int which) { … } int t3_mac_disable(struct cmac *mac, int which) { … } int t3b2_mac_watchdog_task(struct cmac *mac) { … } /* * This function is called periodically to accumulate the current values of the * RMON counters into the port statistics. Since the packet counters are only * 32 bits they can overflow in ~286 secs at 10G, so the function should be * called more frequently than that. The byte counters are 45-bit wide, they * would overflow in ~7.8 hours. */ const struct mac_stats *t3_mac_update_stats(struct cmac *mac) { … }