Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6103
b: refs/heads/master
c: 5e1705d
h: refs/heads/master
i:
  6101: ccb9335
  6099: 1ced234
  6095: 8c8d6e0
v: v3
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Aug 16, 2005
1 parent 0b9a2fe commit d876063
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 24 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: 050ec18a35f3106437da8e9c55e441c076c7b93e
refs/heads/master: 5e1705ddc83f77da4b29a6d687da14e971912e41
26 changes: 12 additions & 14 deletions trunk/drivers/net/skge.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ static u32 skge_supported_modes(const struct skge_hw *hw)
{
u32 supported;

if (iscopper(hw)) {
if (hw->copper) {
supported = SUPPORTED_10baseT_Half
| SUPPORTED_10baseT_Full
| SUPPORTED_100baseT_Half
Expand Down Expand Up @@ -222,7 +222,7 @@ static int skge_get_settings(struct net_device *dev,
ecmd->transceiver = XCVR_INTERNAL;
ecmd->supported = skge_supported_modes(hw);

if (iscopper(hw)) {
if (hw->copper) {
ecmd->port = PORT_TP;
ecmd->phy_address = hw->phy_addr;
} else
Expand Down Expand Up @@ -1599,7 +1599,7 @@ static void yukon_init(struct skge_hw *hw, int port)
adv = PHY_AN_CSMA;

if (skge->autoneg == AUTONEG_ENABLE) {
if (iscopper(hw)) {
if (hw->copper) {
if (skge->advertising & ADVERTISED_1000baseT_Full)
ct1000 |= PHY_M_1000C_AFD;
if (skge->advertising & ADVERTISED_1000baseT_Half)
Expand Down Expand Up @@ -1691,7 +1691,7 @@ static void yukon_mac_init(struct skge_hw *hw, int port)
/* Set hardware config mode */
reg = GPC_INT_POL_HI | GPC_DIS_FC | GPC_DIS_SLEEP |
GPC_ENA_XC | GPC_ANEG_ADV_ALL_M | GPC_ENA_PAUSE;
reg |= iscopper(hw) ? GPC_HWCFG_GMII_COP : GPC_HWCFG_GMII_FIB;
reg |= hw->copper ? GPC_HWCFG_GMII_COP : GPC_HWCFG_GMII_FIB;

/* Clear GMC reset */
skge_write32(hw, SK_REG(port, GPHY_CTRL), reg | GPC_RST_SET);
Expand Down Expand Up @@ -2865,7 +2865,7 @@ static const char *skge_board_name(const struct skge_hw *hw)
static int skge_reset(struct skge_hw *hw)
{
u16 ctst;
u8 t8, mac_cfg;
u8 t8, mac_cfg, pmd_type, phy_type;
int i;

ctst = skge_read16(hw, B0_CTST);
Expand All @@ -2884,32 +2884,30 @@ static int skge_reset(struct skge_hw *hw)
ctst & (CS_CLK_RUN_HOT|CS_CLK_RUN_RST|CS_CLK_RUN_ENA));

hw->chip_id = skge_read8(hw, B2_CHIP_ID);
hw->phy_type = skge_read8(hw, B2_E_1) & 0xf;
hw->pmd_type = skge_read8(hw, B2_PMD_TYP);
phy_type = skge_read8(hw, B2_E_1) & 0xf;
pmd_type = skge_read8(hw, B2_PMD_TYP);
hw->copper = (pmd_type == 'T' || pmd_type == '1');

switch (hw->chip_id) {
case CHIP_ID_GENESIS:
switch (hw->phy_type) {
switch (phy_type) {
case SK_PHY_BCOM:
hw->phy_addr = PHY_ADDR_BCOM;
break;
default:
printk(KERN_ERR PFX "%s: unsupported phy type 0x%x\n",
pci_name(hw->pdev), hw->phy_type);
pci_name(hw->pdev), phy_type);
return -EOPNOTSUPP;
}
break;

case CHIP_ID_YUKON:
case CHIP_ID_YUKON_LITE:
case CHIP_ID_YUKON_LP:
if (hw->phy_type < SK_PHY_MARV_COPPER && hw->pmd_type != 'S')
hw->phy_type = SK_PHY_MARV_COPPER;
if (phy_type < SK_PHY_MARV_COPPER && pmd_type != 'S')
hw->copper = 1;

hw->phy_addr = PHY_ADDR_MARV;
if (!iscopper(hw))
hw->phy_type = SK_PHY_MARV_FIBER;

break;

default:
Expand Down
11 changes: 2 additions & 9 deletions trunk/drivers/net/skge.h
Original file line number Diff line number Diff line change
Expand Up @@ -2460,24 +2460,17 @@ struct skge_hw {

u8 chip_id;
u8 chip_rev;
u8 phy_type;
u8 pmd_type;
u16 phy_addr;
u8 copper;
u8 ports;

u32 ram_size;
u32 ram_offset;
u16 phy_addr;

struct tasklet_struct ext_tasklet;
spinlock_t phy_lock;
};


static inline int iscopper(const struct skge_hw *hw)
{
return (hw->pmd_type == 'T');
}

enum {
FLOW_MODE_NONE = 0, /* No Flow-Control */
FLOW_MODE_LOC_SEND = 1, /* Local station sends PAUSE */
Expand Down

0 comments on commit d876063

Please sign in to comment.