tasklet_init(&sp->rx_tasklet, rx_tasklet_func, (unsigned long) dev);
tasklet_disable(&sp->rx_tasklet);
tasklet_init(&sp->rx_tasklet, rx_tasklet_func, (unsigned long) dev);
tasklet_disable(&sp->rx_tasklet);
sp->mii_bus.id = 0;
sp->mii_bus.irq = kmalloc(sizeof(int), GFP_KERNEL);
*sp->mii_bus.irq = PHY_POLL;
sp->mii_bus.id = 0;
sp->mii_bus.irq = kmalloc(sizeof(int), GFP_KERNEL);
*sp->mii_bus.irq = PHY_POLL;
ptr = (unsigned int *) sp->eth_regs;
for (i = 0; i < (sizeof(ETHERNET_STRUCT) / sizeof(unsigned int));
ptr = (unsigned int *) sp->eth_regs;
for (i = 0; i < (sizeof(ETHERNET_STRUCT) / sizeof(unsigned int));
* Tasklet may be scheduled. Need to get it removed from the list
* since we're about to free the struct.
*/
* Tasklet may be scheduled. Need to get it removed from the list
* since we're about to free the struct.
*/
static void ar2313_link_timer_fn(unsigned long data)
{
struct net_device *dev = (struct net_device *) data;
static void ar2313_link_timer_fn(unsigned long data)
{
struct net_device *dev = (struct net_device *) data;
// see if the link status changed
// This was needed to make sure we set the PHY to the
// autonegotiated value of half or full duplex.
ar2313_check_link(dev);
// see if the link status changed
// This was needed to make sure we set the PHY to the
// autonegotiated value of half or full duplex.
ar2313_check_link(dev);
// This was needed to speed up the AP bootstrap time.
if (sp->link == 0) {
mod_timer(&sp->link_timer, jiffies + HZ / 2);
// This was needed to speed up the AP bootstrap time.
if (sp->link == 0) {
mod_timer(&sp->link_timer, jiffies + HZ / 2);
* Set tx_csm before we start receiving interrupts, otherwise
* the interrupt handler might think it is supposed to process
* tx ints before we are up and running, which may cause a null
* Set tx_csm before we start receiving interrupts, otherwise
* the interrupt handler might think it is supposed to process
* tx ints before we are up and running, which may cause a null
* We load the ring here as there seem to be no way to tell the
* firmware to wipe the ring without re-initializing it.
*/
ar2313_load_rx_ring(dev, RX_RING_SIZE);
* We load the ring here as there seem to be no way to tell the
* firmware to wipe the ring without re-initializing it.
*/
ar2313_load_rx_ring(dev, RX_RING_SIZE);
skb->protocol = eth_type_trans(skb, dev);
/* pass the packet to upper layers */
netif_rx(skb);
skb->protocol = eth_type_trans(skb, dev);
/* pass the packet to upper layers */
netif_rx(skb);
static irqreturn_t ar2313_interrupt(int irq, void *dev_id)
{
struct net_device *dev = (struct net_device *) dev_id;
static irqreturn_t ar2313_interrupt(int irq, void *dev_id)
{
struct net_device *dev = (struct net_device *) dev_id;
* Without (or before) releasing irq and stopping hardware, this
* is an absolute non-sense, by the way. It will be reset instantly
* by the first irq.
* Without (or before) releasing irq and stopping hardware, this
* is an absolute non-sense, by the way. It will be reset instantly
* by the first irq.
printk("%s: No space left to Tx\n", __FUNCTION__);
#endif
/* free skbuf and lie to the caller that we sent it out */
printk("%s: No space left to Tx\n", __FUNCTION__);
#endif
/* free skbuf and lie to the caller that we sent it out */
static int ar2313_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct mii_ioctl_data *data = (struct mii_ioctl_data *) &ifr->ifr_data;
static int ar2313_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct mii_ioctl_data *data = (struct mii_ioctl_data *) &ifr->ifr_data;
#define MII_ADDR(phy, reg) \
((reg << MII_ADDR_REG_SHIFT) | (phy << MII_ADDR_PHY_SHIFT))
#define MII_ADDR(phy, reg) \
((reg << MII_ADDR_REG_SHIFT) | (phy << MII_ADDR_PHY_SHIFT))
mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum)
{
struct net_device *const dev = bus->priv;
mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum)
{
struct net_device *const dev = bus->priv;
volatile ETHERNET_STRUCT *ethernet = sp->phy_regs;
ethernet->mii_addr = MII_ADDR(phy_addr, regnum);
volatile ETHERNET_STRUCT *ethernet = sp->phy_regs;
ethernet->mii_addr = MII_ADDR(phy_addr, regnum);
mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum,
u16 value)
{
struct net_device *const dev = bus->priv;
mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum,
u16 value)
{
struct net_device *const dev = bus->priv;