diff options
| author | Stephen Hemminger <shemminger@osdl.org> | 2006-05-08 18:11:31 -0400 |
|---|---|---|
| committer | Stephen Hemminger <shemminger@osdl.org> | 2006-05-08 19:00:27 -0400 |
| commit | e71ebd73276cc21efc74aba4118ef037cd32e50a (patch) | |
| tree | f19a898ff09d4d78e3334b33c08c48a7bd77ced1 /drivers/net/sky2.c | |
| parent | 01bd75645f94d49cb7ffd61022890166ce00ec2a (diff) | |
sky2: dont write status ring
It is more efficient not to write the status ring from the
processor and just read the active portion.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Diffstat (limited to 'drivers/net/sky2.c')
| -rw-r--r-- | drivers/net/sky2.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 940ed699a702..ea23da53677b 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
| @@ -1865,35 +1865,28 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last) | |||
| 1865 | static int sky2_status_intr(struct sky2_hw *hw, int to_do) | 1865 | static int sky2_status_intr(struct sky2_hw *hw, int to_do) |
| 1866 | { | 1866 | { |
| 1867 | int work_done = 0; | 1867 | int work_done = 0; |
| 1868 | u16 hwidx = sky2_read16(hw, STAT_PUT_IDX); | ||
| 1868 | 1869 | ||
| 1869 | rmb(); | 1870 | rmb(); |
| 1870 | 1871 | ||
| 1871 | for(;;) { | 1872 | while (hw->st_idx != hwidx) { |
| 1872 | struct sky2_status_le *le = hw->st_le + hw->st_idx; | 1873 | struct sky2_status_le *le = hw->st_le + hw->st_idx; |
| 1873 | struct net_device *dev; | 1874 | struct net_device *dev; |
| 1874 | struct sky2_port *sky2; | 1875 | struct sky2_port *sky2; |
| 1875 | struct sk_buff *skb; | 1876 | struct sk_buff *skb; |
| 1876 | u32 status; | 1877 | u32 status; |
| 1877 | u16 length; | 1878 | u16 length; |
| 1878 | u8 link, opcode; | ||
| 1879 | |||
| 1880 | opcode = le->opcode; | ||
| 1881 | if (!opcode) | ||
| 1882 | break; | ||
| 1883 | opcode &= ~HW_OWNER; | ||
| 1884 | 1879 | ||
| 1885 | hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE); | 1880 | hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE); |
| 1886 | le->opcode = 0; | ||
| 1887 | 1881 | ||
| 1888 | link = le->link; | 1882 | BUG_ON(le->link >= 2); |
| 1889 | BUG_ON(link >= 2); | 1883 | dev = hw->dev[le->link]; |
| 1890 | dev = hw->dev[link]; | ||
| 1891 | 1884 | ||
| 1892 | sky2 = netdev_priv(dev); | 1885 | sky2 = netdev_priv(dev); |
| 1893 | length = le->length; | 1886 | length = le->length; |
| 1894 | status = le->status; | 1887 | status = le->status; |
| 1895 | 1888 | ||
| 1896 | switch (opcode) { | 1889 | switch (le->opcode & ~HW_OWNER) { |
| 1897 | case OP_RXSTAT: | 1890 | case OP_RXSTAT: |
| 1898 | skb = sky2_receive(sky2, length, status); | 1891 | skb = sky2_receive(sky2, length, status); |
| 1899 | if (!skb) | 1892 | if (!skb) |
| @@ -1944,8 +1937,8 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do) | |||
| 1944 | default: | 1937 | default: |
| 1945 | if (net_ratelimit()) | 1938 | if (net_ratelimit()) |
| 1946 | printk(KERN_WARNING PFX | 1939 | printk(KERN_WARNING PFX |
| 1947 | "unknown status opcode 0x%x\n", opcode); | 1940 | "unknown status opcode 0x%x\n", le->opcode); |
| 1948 | break; | 1941 | goto exit_loop; |
| 1949 | } | 1942 | } |
| 1950 | } | 1943 | } |
| 1951 | 1944 | ||
