Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40145
b: refs/heads/master
c: 470ea7e
h: refs/heads/master
i:
  40143: ae9e5e1
v: v3
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Oct 21, 2006
1 parent 2200214 commit cfc0be8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 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: 7347b03d25ad7d7f001373cf64f709457c6af618
refs/heads/master: 470ea7eba4aaa517533f9b02ac9a104e77264548
33 changes: 12 additions & 21 deletions trunk/drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,16 +699,10 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)

}

/* Assign Ram Buffer allocation.
* start and end are in units of 4k bytes
* ram registers are in units of 64bit words
*/
static void sky2_ramset(struct sky2_hw *hw, u16 q, u8 startk, u8 endk)
/* Assign Ram Buffer allocation in units of 64bit (8 bytes) */
static void sky2_ramset(struct sky2_hw *hw, u16 q, u32 start, u32 end)
{
u32 start, end;

start = startk * 4096/8;
end = (endk * 4096/8) - 1;
pr_debug(PFX "q %d %#x %#x\n", q, start, end);

sky2_write8(hw, RB_ADDR(q, RB_CTRL), RB_RST_CLR);
sky2_write32(hw, RB_ADDR(q, RB_START), start);
Expand All @@ -717,7 +711,7 @@ static void sky2_ramset(struct sky2_hw *hw, u16 q, u8 startk, u8 endk)
sky2_write32(hw, RB_ADDR(q, RB_RP), start);

if (q == Q_R1 || q == Q_R2) {
u32 space = (endk - startk) * 4096/8;
u32 space = end - start + 1;
u32 tp = space - space/4;

/* On receive queue's set the thresholds
Expand Down Expand Up @@ -1199,19 +1193,16 @@ static int sky2_up(struct net_device *dev)

sky2_mac_init(hw, port);

/* Determine available ram buffer space (in 4K blocks).
* Note: not sure about the FE setting below yet
*/
if (hw->chip_id == CHIP_ID_YUKON_FE)
ramsize = 4;
else
ramsize = sky2_read8(hw, B2_E_0);
/* Determine available ram buffer space in qwords. */
ramsize = sky2_read8(hw, B2_E_0) * 4096/8;

/* Give transmitter one third (rounded up) */
rxspace = ramsize - (ramsize + 2) / 3;
if (ramsize > 6*1024/8)
rxspace = ramsize - (ramsize + 2) / 3;
else
rxspace = ramsize / 2;

sky2_ramset(hw, rxqaddr[port], 0, rxspace);
sky2_ramset(hw, txqaddr[port], rxspace, ramsize);
sky2_ramset(hw, rxqaddr[port], 0, rxspace-1);
sky2_ramset(hw, txqaddr[port], rxspace, ramsize-1);

/* Make sure SyncQ is disabled */
sky2_write8(hw, RB_ADDR(port == 0 ? Q_XS1 : Q_XS2, RB_CTRL),
Expand Down

0 comments on commit cfc0be8

Please sign in to comment.