Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328093
b: refs/heads/master
c: b98b8ba
h: refs/heads/master
i:
  328091: 3457c05
v: v3
  • Loading branch information
Claudiu Manoil authored and David S. Miller committed Sep 24, 2012
1 parent 0bd7200 commit e1412b6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0cf833aefaa85bbfce3ff70485e5534e09254773
refs/heads/master: b98b8babd6e3370fadb7c6eaacb00eb2f6344a6c
11 changes: 10 additions & 1 deletion trunk/drivers/net/ethernet/freescale/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,13 @@ static void gfar_init_mac(struct net_device *ndev)
if (ndev->features & NETIF_F_IP_CSUM)
tctrl |= TCTRL_INIT_CSUM;

tctrl |= TCTRL_TXSCHED_PRIO;
if (priv->prio_sched_en)
tctrl |= TCTRL_TXSCHED_PRIO;
else {
tctrl |= TCTRL_TXSCHED_WRRS;
gfar_write(&regs->tr03wt, DEFAULT_WRRS_WEIGHT);
gfar_write(&regs->tr47wt, DEFAULT_WRRS_WEIGHT);
}

gfar_write(&regs->tctrl, tctrl);

Expand Down Expand Up @@ -1160,6 +1166,9 @@ static int gfar_probe(struct platform_device *ofdev)
priv->rx_filer_enable = 1;
/* Enable most messages by default */
priv->msg_enable = (NETIF_MSG_IFUP << 1 ) - 1;
/* use pritority h/w tx queue scheduling for single queue devices */
if (priv->num_tx_queues == 1)
priv->prio_sched_en = 1;

/* Carrier starts down, phylib will bring it up */
netif_carrier_off(dev);
Expand Down
11 changes: 10 additions & 1 deletion trunk/drivers/net/ethernet/freescale/gianfar.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,16 @@ extern const char gfar_driver_version[];
#define TCTRL_TFCPAUSE 0x00000008
#define TCTRL_TXSCHED_MASK 0x00000006
#define TCTRL_TXSCHED_INIT 0x00000000
/* priority scheduling */
#define TCTRL_TXSCHED_PRIO 0x00000002
/* weighted round-robin scheduling (WRRS) */
#define TCTRL_TXSCHED_WRRS 0x00000004
/* default WRRS weight and policy setting,
* tailored to the tr03wt and tr47wt registers:
* equal weight for all Tx Qs, measured in 64byte units
*/
#define DEFAULT_WRRS_WEIGHT 0x18181818

#define TCTRL_INIT_CSUM (TCTRL_TUCSEN | TCTRL_IPCSEN)

#define IEVENT_INIT_CLEAR 0xffffffff
Expand Down Expand Up @@ -1098,7 +1106,8 @@ struct gfar_private {
extended_hash:1,
bd_stash_en:1,
rx_filer_enable:1,
wol_en:1; /* Wake-on-LAN enabled */
wol_en:1, /* Wake-on-LAN enabled */
prio_sched_en:1; /* Enable priorty based Tx scheduling in Hw */
unsigned short padding;

/* PHY stuff */
Expand Down

0 comments on commit e1412b6

Please sign in to comment.