#define pr_fmt(fmt) …
#include <linux/bcma/bcma.h>
#include <linux/etherdevice.h>
#include <linux/interrupt.h>
#include <linux/bcm47xx_nvram.h>
#include <linux/phy.h>
#include <linux/phy_fixed.h>
#include <net/dsa.h>
#include "bgmac.h"
static bool bgmac_wait_value(struct bgmac *bgmac, u16 reg, u32 mask,
u32 value, int timeout)
{ … }
static void bgmac_dma_tx_reset(struct bgmac *bgmac, struct bgmac_dma_ring *ring)
{ … }
static void bgmac_dma_tx_enable(struct bgmac *bgmac,
struct bgmac_dma_ring *ring)
{ … }
static void
bgmac_dma_tx_add_buf(struct bgmac *bgmac, struct bgmac_dma_ring *ring,
int i, int len, u32 ctl0)
{ … }
static netdev_tx_t bgmac_dma_tx_add(struct bgmac *bgmac,
struct bgmac_dma_ring *ring,
struct sk_buff *skb)
{ … }
static void bgmac_dma_tx_free(struct bgmac *bgmac, struct bgmac_dma_ring *ring)
{ … }
static void bgmac_dma_rx_reset(struct bgmac *bgmac, struct bgmac_dma_ring *ring)
{ … }
static void bgmac_dma_rx_enable(struct bgmac *bgmac,
struct bgmac_dma_ring *ring)
{ … }
static int bgmac_dma_rx_skb_for_slot(struct bgmac *bgmac,
struct bgmac_slot_info *slot)
{ … }
static void bgmac_dma_rx_update_index(struct bgmac *bgmac,
struct bgmac_dma_ring *ring)
{ … }
static void bgmac_dma_rx_setup_desc(struct bgmac *bgmac,
struct bgmac_dma_ring *ring, int desc_idx)
{ … }
static void bgmac_dma_rx_poison_buf(struct device *dma_dev,
struct bgmac_slot_info *slot)
{ … }
static int bgmac_dma_rx_read(struct bgmac *bgmac, struct bgmac_dma_ring *ring,
int weight)
{ … }
static bool bgmac_dma_unaligned(struct bgmac *bgmac,
struct bgmac_dma_ring *ring,
enum bgmac_dma_ring_type ring_type)
{ … }
static void bgmac_dma_tx_ring_free(struct bgmac *bgmac,
struct bgmac_dma_ring *ring)
{ … }
static void bgmac_dma_rx_ring_free(struct bgmac *bgmac,
struct bgmac_dma_ring *ring)
{ … }
static void bgmac_dma_ring_desc_free(struct bgmac *bgmac,
struct bgmac_dma_ring *ring,
int num_slots)
{ … }
static void bgmac_dma_cleanup(struct bgmac *bgmac)
{ … }
static void bgmac_dma_free(struct bgmac *bgmac)
{ … }
static int bgmac_dma_alloc(struct bgmac *bgmac)
{ … }
static int bgmac_dma_init(struct bgmac *bgmac)
{ … }
static void bgmac_umac_cmd_maskset(struct bgmac *bgmac, u32 mask, u32 set,
bool force)
{ … }
static void bgmac_write_mac_address(struct bgmac *bgmac, const u8 *addr)
{ … }
static void bgmac_set_rx_mode(struct net_device *net_dev)
{ … }
#if 0
static void bgmac_chip_stats_update(struct bgmac *bgmac)
{
int i;
if (!(bgmac->feature_flags & BGMAC_FEAT_NO_CLR_MIB)) {
for (i = 0; i < BGMAC_NUM_MIB_TX_REGS; i++)
bgmac->mib_tx_regs[i] =
bgmac_read(bgmac,
BGMAC_TX_GOOD_OCTETS + (i * 4));
for (i = 0; i < BGMAC_NUM_MIB_RX_REGS; i++)
bgmac->mib_rx_regs[i] =
bgmac_read(bgmac,
BGMAC_RX_GOOD_OCTETS + (i * 4));
}
}
#endif
static void bgmac_clear_mib(struct bgmac *bgmac)
{ … }
static void bgmac_mac_speed(struct bgmac *bgmac)
{ … }
static void bgmac_miiconfig(struct bgmac *bgmac)
{ … }
static void bgmac_chip_reset_idm_config(struct bgmac *bgmac)
{ … }
static void bgmac_chip_reset(struct bgmac *bgmac)
{ … }
static void bgmac_chip_intrs_on(struct bgmac *bgmac)
{ … }
static void bgmac_chip_intrs_off(struct bgmac *bgmac)
{ … }
static void bgmac_enable(struct bgmac *bgmac)
{ … }
static void bgmac_chip_init(struct bgmac *bgmac)
{ … }
static irqreturn_t bgmac_interrupt(int irq, void *dev_id)
{ … }
static int bgmac_poll(struct napi_struct *napi, int weight)
{ … }
static int bgmac_open(struct net_device *net_dev)
{ … }
static int bgmac_stop(struct net_device *net_dev)
{ … }
static netdev_tx_t bgmac_start_xmit(struct sk_buff *skb,
struct net_device *net_dev)
{ … }
static int bgmac_set_mac_address(struct net_device *net_dev, void *addr)
{ … }
static int bgmac_change_mtu(struct net_device *net_dev, int mtu)
{ … }
static const struct net_device_ops bgmac_netdev_ops = …;
struct bgmac_stat { … };
static struct bgmac_stat bgmac_get_strings_stats[] = …;
#define BGMAC_STATS_LEN …
static int bgmac_get_sset_count(struct net_device *dev, int string_set)
{ … }
static void bgmac_get_strings(struct net_device *dev, u32 stringset,
u8 *data)
{ … }
static void bgmac_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *ss, uint64_t *data)
{ … }
static void bgmac_get_drvinfo(struct net_device *net_dev,
struct ethtool_drvinfo *info)
{ … }
static const struct ethtool_ops bgmac_ethtool_ops = …;
void bgmac_adjust_link(struct net_device *net_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
int bgmac_phy_connect_direct(struct bgmac *bgmac)
{ … }
EXPORT_SYMBOL_GPL(…);
struct bgmac *bgmac_alloc(struct device *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
int bgmac_enet_probe(struct bgmac *bgmac)
{ … }
EXPORT_SYMBOL_GPL(…);
void bgmac_enet_remove(struct bgmac *bgmac)
{ … }
EXPORT_SYMBOL_GPL(…);
int bgmac_enet_suspend(struct bgmac *bgmac)
{ … }
EXPORT_SYMBOL_GPL(…);
int bgmac_enet_resume(struct bgmac *bgmac)
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;