Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96212
b: refs/heads/master
c: c416a41
h: refs/heads/master
v: v3
  • Loading branch information
Lennert Buytenhek authored and Dale Farnsworth committed Apr 29, 2008
1 parent cc827ff commit 27c2e15
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 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: f2ce825d2a89b30af14fa577298fecaab7bc9504
refs/heads/master: c416a41f99be190e1f558cb06f70ddd560ce8b4b
17 changes: 9 additions & 8 deletions trunk/drivers/net/mv643xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@ struct mv643xx_shared_private {
spinlock_t phy_lock;

u32 win_protect;

unsigned int t_clk;
};

struct mv643xx_private {
Expand Down Expand Up @@ -1129,7 +1131,6 @@ static irqreturn_t mv643xx_eth_int_handler(int irq, void *dev_id)
*
* INPUT:
* struct mv643xx_private *mp Ethernet port
* unsigned int t_clk t_clk of the MV-643xx chip in HZ units
* unsigned int delay Delay in usec
*
* OUTPUT:
Expand All @@ -1140,10 +1141,10 @@ static irqreturn_t mv643xx_eth_int_handler(int irq, void *dev_id)
*
*/
static unsigned int eth_port_set_rx_coal(struct mv643xx_private *mp,
unsigned int t_clk, unsigned int delay)
unsigned int delay)
{
unsigned int port_num = mp->port_num;
unsigned int coal = ((t_clk / 1000000) * delay) / 64;
unsigned int coal = ((mp->shared->t_clk / 1000000) * delay) / 64;

/* Set RX Coalescing mechanism */
wrl(mp, SDMA_CONFIG_REG(port_num),
Expand All @@ -1168,7 +1169,6 @@ static unsigned int eth_port_set_rx_coal(struct mv643xx_private *mp,
*
* INPUT:
* struct mv643xx_private *mp Ethernet port
* unsigned int t_clk t_clk of the MV-643xx chip in HZ units
* unsigned int delay Delay in uSeconds
*
* OUTPUT:
Expand All @@ -1179,9 +1179,9 @@ static unsigned int eth_port_set_rx_coal(struct mv643xx_private *mp,
*
*/
static unsigned int eth_port_set_tx_coal(struct mv643xx_private *mp,
unsigned int t_clk, unsigned int delay)
unsigned int delay)
{
unsigned int coal = ((t_clk / 1000000) * delay) / 64;
unsigned int coal = ((mp->shared->t_clk / 1000000) * delay) / 64;

/* Set TX Coalescing mechanism */
wrl(mp, TX_FIFO_URGENT_THRESHOLD_REG(mp->port_num), coal << 4);
Expand Down Expand Up @@ -1423,11 +1423,11 @@ static int mv643xx_eth_open(struct net_device *dev)

#ifdef MV643XX_COAL
mp->rx_int_coal =
eth_port_set_rx_coal(mp, 133000000, MV643XX_RX_COAL);
eth_port_set_rx_coal(mp, MV643XX_RX_COAL);
#endif

mp->tx_int_coal =
eth_port_set_tx_coal(mp, 133000000, MV643XX_TX_COAL);
eth_port_set_tx_coal(mp, MV643XX_TX_COAL);

/* Unmask phy and link status changes interrupts */
wrl(mp, INTERRUPT_EXTEND_MASK_REG(port_num), ETH_INT_UNMASK_ALL_EXT);
Expand Down Expand Up @@ -2063,6 +2063,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
goto out_free;

spin_lock_init(&msp->phy_lock);
msp->t_clk = (pd != NULL && pd->t_clk != 0) ? pd->t_clk : 133000000;

platform_set_drvdata(pdev, msp);

Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/mv643xx_eth.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

struct mv643xx_eth_shared_platform_data {
struct mbus_dram_target_info *dram;
unsigned int t_clk;
};

struct mv643xx_eth_platform_data {
Expand Down

0 comments on commit 27c2e15

Please sign in to comment.