* consume in the event that some partial datagrams are never completed. This
* should probably change to a sysctl item or the like if possible.
*/
-MODULE_PARM(max_partial_datagrams, "i");
+static int max_partial_datagrams = 25;
+module_param(max_partial_datagrams, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(max_partial_datagrams,
"Maximum number of partially received fragmented datagrams "
"(default = 25).");
-static int max_partial_datagrams = 25;
static int ether1394_header(struct sk_buff *skb, struct net_device *dev,
static int ether1394_tx(struct sk_buff *skb, struct net_device *dev);
static void ether1394_iso(struct hpsb_iso *iso);
-static int ether1394_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
-static int ether1394_ethtool_ioctl(struct net_device *dev, void __user *useraddr);
+static struct ethtool_ops ethtool_ops;
static int ether1394_write(struct hpsb_host *host, int srcid, int destid,
quadlet_t *data, u64 addr, size_t len, u16 flags);
/* This is called after an "ifup" */
static int ether1394_open (struct net_device *dev)
{
- struct eth1394_priv *priv = dev->priv;
+ struct eth1394_priv *priv = netdev_priv(dev);
int ret = 0;
/* Something bad happened, don't even try */
/* Return statistics to the caller */
static struct net_device_stats *ether1394_stats (struct net_device *dev)
{
- return &(((struct eth1394_priv *)dev->priv)->stats);
+ return &(((struct eth1394_priv *)netdev_priv(dev))->stats);
}
/* What to do if we timeout. I think a host reset is probably in order, so
static void ether1394_tx_timeout (struct net_device *dev)
{
ETH1394_PRINT (KERN_ERR, dev->name, "Timeout, resetting host %s\n",
- ((struct eth1394_priv *)(dev->priv))->host->driver->name);
+ ((struct eth1394_priv *)netdev_priv(dev))->host->driver->name);
- highlevel_host_reset (((struct eth1394_priv *)(dev->priv))->host);
+ highlevel_host_reset (((struct eth1394_priv *)netdev_priv(dev))->host);
netif_wake_queue (dev);
}
static int ether1394_change_mtu(struct net_device *dev, int new_mtu)
{
- struct eth1394_priv *priv = dev->priv;
+ struct eth1394_priv *priv = netdev_priv(dev);
if ((new_mtu < 68) ||
(new_mtu > min(ETH1394_DATA_LEN,
ud->device.driver_data = node_info;
new_node->ud = ud;
- priv = (struct eth1394_priv *)hi->dev->priv;
+ priv = netdev_priv(hi->dev);
list_add_tail(&new_node->list, &priv->ip_node_list);
return 0;
if (!hi)
return -ENOENT;
- priv = (struct eth1394_priv *)hi->dev->priv;
+ priv = netdev_priv(hi->dev);
old_node = eth1394_find_node(&priv->ip_node_list, ud);
if (!hi)
return -ENOENT;
- priv = (struct eth1394_priv *)hi->dev->priv;
+ priv = netdev_priv(hi->dev);
node = eth1394_find_node(&priv->ip_node_list, ud);
ud->device.driver_data = node_info;
node->ud = ud;
- priv = (struct eth1394_priv *)hi->dev->priv;
+ priv = netdev_priv(hi->dev);
list_add_tail(&node->list, &priv->ip_node_list);
}
{
unsigned long flags;
int i;
- struct eth1394_priv *priv = dev->priv;
+ struct eth1394_priv *priv = netdev_priv(dev);
struct hpsb_host *host = priv->host;
u64 guid = *((u64*)&(host->csr.rom->bus_info_data[3]));
u16 maxpayload = 1 << (host->csr.max_rec + 1);
dev->header_cache_update= ether1394_header_cache_update;
dev->hard_header_parse = ether1394_header_parse;
dev->set_mac_address = ether1394_mac_addr;
- dev->do_ioctl = ether1394_do_ioctl;
+ SET_ETHTOOL_OPS(dev, ðtool_ops);
/* Some constants */
dev->watchdog_timeo = ETHER1394_TIMEOUT;
}
SET_MODULE_OWNER(dev);
+ SET_NETDEV_DEV(dev, &host->device);
- priv = (struct eth1394_priv *)dev->priv;
+ priv = netdev_priv(dev);
INIT_LIST_HEAD(&priv->ip_node_list);
hi = hpsb_get_hostinfo(ð1394_highlevel, host);
if (hi != NULL) {
- struct eth1394_priv *priv = (struct eth1394_priv *)hi->dev->priv;
+ struct eth1394_priv *priv = netdev_priv(hi->dev);
hpsb_unregister_addrspace(ð1394_highlevel, host,
priv->local_fifo);
return;
dev = hi->dev;
- priv = (struct eth1394_priv *)dev->priv;
+ priv = netdev_priv(dev);
/* Reset our private host data, but not our mtu */
netif_stop_queue (dev);
nodeid_t srcid, nodeid_t destid,
u16 ether_type)
{
- struct eth1394_priv *priv = dev->priv;
+ struct eth1394_priv *priv = netdev_priv(dev);
u64 dest_hw;
unsigned short ret = 0;
{
struct sk_buff *skb;
unsigned long flags;
- struct eth1394_priv *priv = (struct eth1394_priv *)dev->priv;
+ struct eth1394_priv *priv = netdev_priv(dev);
union eth1394_hdr *hdr = (union eth1394_hdr *)buf;
u16 ether_type = 0; /* initialized to clear warning */
int hdr_len;
((be32_to_cpu(data[1]) & 0xff000000) >> 24));
source_id = be32_to_cpu(data[0]) >> 16;
- priv = (struct eth1394_priv *)dev->priv;
+ priv = netdev_priv(dev);
if (info->channel != (iso->host->csr.broadcast_channel & 0x3f) ||
specifier_id != ETHER1394_GASP_SPECIFIER_ID) {
static inline void ether1394_arp_to_1394arp(struct sk_buff *skb,
struct net_device *dev)
{
- struct eth1394_priv *priv = (struct eth1394_priv *)(dev->priv);
+ struct eth1394_priv *priv = netdev_priv(dev);
struct arphdr *arp = (struct arphdr *)skb->data;
unsigned char *arp_ptr = (unsigned char *)(arp + 1);
{
struct sk_buff *skb = ptask->skb;
struct net_device *dev = skb->dev;
- struct eth1394_priv *priv = dev->priv;
+ struct eth1394_priv *priv = netdev_priv(dev);
unsigned long flags;
/* Statistics */
{
int kmflags = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
struct eth1394hdr *eth;
- struct eth1394_priv *priv = dev->priv;
+ struct eth1394_priv *priv = netdev_priv(dev);
int proto;
unsigned long flags;
nodeid_t dest_node;
return 0; /* returning non-zero causes serious problems */
}
-static int ether1394_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
-{
- switch(cmd) {
- case SIOCETHTOOL:
- return ether1394_ethtool_ioctl(dev, ifr->ifr_data);
-
- case SIOCGMIIPHY: /* Get address of MII PHY in use. */
- case SIOCGMIIREG: /* Read MII PHY register. */
- case SIOCSMIIREG: /* Write MII PHY register. */
- default:
- return -EOPNOTSUPP;
- }
-
- return 0;
-}
-
-static int ether1394_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
+static void ether1394_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{
- u32 ethcmd;
-
- if (get_user(ethcmd, (u32 __user *)useraddr))
- return -EFAULT;
-
- switch (ethcmd) {
- case ETHTOOL_GDRVINFO: {
- struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO };
- strcpy (info.driver, driver_name);
- strcpy (info.version, "$Rev: 1224 $");
- /* FIXME XXX provide sane businfo */
- strcpy (info.bus_info, "ieee1394");
- if (copy_to_user (useraddr, &info, sizeof (info)))
- return -EFAULT;
- break;
- }
- case ETHTOOL_GSET:
- case ETHTOOL_SSET:
- case ETHTOOL_NWAY_RST:
- case ETHTOOL_GLINK:
- case ETHTOOL_GMSGLVL:
- case ETHTOOL_SMSGLVL:
- default:
- return -EOPNOTSUPP;
- }
-
- return 0;
+ strcpy (info->driver, driver_name);
+ strcpy (info->version, "$Rev: 1224 $");
+ /* FIXME XXX provide sane businfo */
+ strcpy (info->bus_info, "ieee1394");
}
+static struct ethtool_ops ethtool_ops = {
+ .get_drvinfo = ether1394_get_drvinfo
+};
static int __init ether1394_init_module (void)
{