Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21287
b: refs/heads/master
c: 60a89ff
h: refs/heads/master
i:
  21285: d4320ce
  21283: 875c14f
  21279: 46f16d9
v: v3
  • Loading branch information
Pekka Enberg authored and Jeff Garzik committed Mar 12, 2006
1 parent a918e90 commit 9c4b96c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 48 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: 827700866ad0996e8c0f5ce75d1c01ae9b034cd6
refs/heads/master: 60a89ff6d2681029b3d46b5d23dccf2903a254b4
70 changes: 23 additions & 47 deletions trunk/drivers/net/3c509.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ static int max_interrupt_work = 10;
static char versionA[] __initdata = DRV_NAME ".c:" DRV_VERSION " " DRV_RELDATE " becker@scyld.com\n";
static char versionB[] __initdata = "http://www.scyld.com/network/3c509.html\n";

#if defined(CONFIG_PM) && (defined(CONFIG_MCA) || defined(CONFIG_EISA))
#define EL3_SUSPEND
#endif

#ifdef EL3_DEBUG
static int el3_debug = EL3_DEBUG;
#else
Expand Down Expand Up @@ -174,9 +178,6 @@ struct el3_private {
/* skb send-queue */
int head, size;
struct sk_buff *queue[SKB_QUEUE_SIZE];
#ifdef CONFIG_PM_LEGACY
struct pm_dev *pmdev;
#endif
enum {
EL3_MCA,
EL3_PNP,
Expand All @@ -201,11 +202,15 @@ static void el3_tx_timeout (struct net_device *dev);
static void el3_down(struct net_device *dev);
static void el3_up(struct net_device *dev);
static struct ethtool_ops ethtool_ops;
#ifdef CONFIG_PM_LEGACY
static int el3_suspend(struct pm_dev *pdev);
static int el3_resume(struct pm_dev *pdev);
static int el3_pm_callback(struct pm_dev *pdev, pm_request_t rqst, void *data);
#ifdef EL3_SUSPEND
static int el3_suspend(struct device *, pm_message_t);
static int el3_resume(struct device *);
#else
#define el3_suspend NULL
#define el3_resume NULL
#endif


/* generic device remove for all device types */
#if defined(CONFIG_EISA) || defined(CONFIG_MCA)
static int el3_device_remove (struct device *device);
Expand All @@ -229,7 +234,9 @@ static struct eisa_driver el3_eisa_driver = {
.driver = {
.name = "3c509",
.probe = el3_eisa_probe,
.remove = __devexit_p (el3_device_remove)
.remove = __devexit_p (el3_device_remove),
.suspend = el3_suspend,
.resume = el3_resume,
}
};
#endif
Expand Down Expand Up @@ -262,6 +269,8 @@ static struct mca_driver el3_mca_driver = {
.bus = &mca_bus_type,
.probe = el3_mca_probe,
.remove = __devexit_p(el3_device_remove),
.suspend = el3_suspend,
.resume = el3_resume,
},
};
#endif /* CONFIG_MCA */
Expand Down Expand Up @@ -362,10 +371,6 @@ static void el3_common_remove (struct net_device *dev)
struct el3_private *lp = netdev_priv(dev);

(void) lp; /* Keep gcc quiet... */
#ifdef CONFIG_PM_LEGACY
if (lp->pmdev)
pm_unregister(lp->pmdev);
#endif
#if defined(__ISAPNP__)
if (lp->type == EL3_PNP)
pnp_device_detach(to_pnp_dev(lp->dev));
Expand Down Expand Up @@ -572,16 +577,6 @@ static int __init el3_probe(int card_idx)
if (err)
goto out1;

#ifdef CONFIG_PM_LEGACY
/* register power management */
lp->pmdev = pm_register(PM_ISA_DEV, card_idx, el3_pm_callback);
if (lp->pmdev) {
struct pm_dev *p;
p = lp->pmdev;
p->data = (struct net_device *)dev;
}
#endif

el3_cards++;
lp->next_dev = el3_root_dev;
el3_root_dev = dev;
Expand Down Expand Up @@ -1480,20 +1475,17 @@ el3_up(struct net_device *dev)
}

/* Power Management support functions */
#ifdef CONFIG_PM_LEGACY
#ifdef EL3_SUSPEND

static int
el3_suspend(struct pm_dev *pdev)
el3_suspend(struct device *pdev, pm_message_t state)
{
unsigned long flags;
struct net_device *dev;
struct el3_private *lp;
int ioaddr;

if (!pdev && !pdev->data)
return -EINVAL;

dev = (struct net_device *)pdev->data;
dev = pdev->driver_data;
lp = netdev_priv(dev);
ioaddr = dev->base_addr;

Expand All @@ -1510,17 +1502,14 @@ el3_suspend(struct pm_dev *pdev)
}

static int
el3_resume(struct pm_dev *pdev)
el3_resume(struct device *pdev)
{
unsigned long flags;
struct net_device *dev;
struct el3_private *lp;
int ioaddr;

if (!pdev && !pdev->data)
return -EINVAL;

dev = (struct net_device *)pdev->data;
dev = pdev->driver_data;
lp = netdev_priv(dev);
ioaddr = dev->base_addr;

Expand All @@ -1536,20 +1525,7 @@ el3_resume(struct pm_dev *pdev)
return 0;
}

static int
el3_pm_callback(struct pm_dev *pdev, pm_request_t rqst, void *data)
{
switch (rqst) {
case PM_SUSPEND:
return el3_suspend(pdev);

case PM_RESUME:
return el3_resume(pdev);
}
return 0;
}

#endif /* CONFIG_PM_LEGACY */
#endif /* EL3_SUSPEND */

/* Parameters that may be passed into the module. */
static int debug = -1;
Expand Down

0 comments on commit 9c4b96c

Please sign in to comment.