wctc4xxp, wcte12xp, wctdm24xxp: Remove check for HAVE_NETDEV_PRIV
DAHDI currently supports kernels >= 2.6.9. netdev_priv() has been in the mainline kernel since versions 2.6.6 so it's available in all the supported kernels. This change is needed to compile against the 3.1 kernel. Signed-off-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10096 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
parent
9fd43e0139
commit
d401ad4233
@ -35,22 +35,16 @@
|
|||||||
|
|
||||||
#ifdef VOICEBUS_NET_DEBUG
|
#ifdef VOICEBUS_NET_DEBUG
|
||||||
|
|
||||||
#ifdef HAVE_NETDEV_PRIV
|
|
||||||
struct voicebus_netdev_priv {
|
struct voicebus_netdev_priv {
|
||||||
struct voicebus *vb;
|
struct voicebus *vb;
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline struct voicebus *
|
static inline struct voicebus *
|
||||||
voicebus_from_netdev(struct net_device *netdev)
|
voicebus_from_netdev(struct net_device *netdev)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_NETDEV_PRIV
|
|
||||||
struct voicebus_netdev_priv *priv;
|
struct voicebus_netdev_priv *priv;
|
||||||
priv = netdev_priv(netdev);
|
priv = netdev_priv(netdev);
|
||||||
return priv->vb;
|
return priv->vb;
|
||||||
#else
|
|
||||||
return netdev->priv;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
@ -209,23 +203,14 @@ int vb_net_register(struct voicebus *vb, const char *board_name)
|
|||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
struct net_device *netdev;
|
struct net_device *netdev;
|
||||||
# ifdef HAVE_NETDEV_PRIV
|
|
||||||
struct voicebus_netdev_priv *priv;
|
struct voicebus_netdev_priv *priv;
|
||||||
# endif
|
|
||||||
const char our_mac[] = { 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
|
const char our_mac[] = { 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
|
||||||
|
|
||||||
# ifdef HAVE_NETDEV_PRIV
|
|
||||||
netdev = alloc_netdev(sizeof(*priv), board_name, ether_setup);
|
netdev = alloc_netdev(sizeof(*priv), board_name, ether_setup);
|
||||||
if (!netdev)
|
if (!netdev)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
priv = netdev_priv(netdev);
|
priv = netdev_priv(netdev);
|
||||||
priv->vb = vb;
|
priv->vb = vb;
|
||||||
# else
|
|
||||||
netdev = alloc_netdev(0, vb->board_name, ether_setup);
|
|
||||||
if (!netdev)
|
|
||||||
return -ENOMEM;
|
|
||||||
netdev->priv = vb;
|
|
||||||
# endif
|
|
||||||
memcpy(netdev->dev_addr, our_mac, sizeof(our_mac));
|
memcpy(netdev->dev_addr, our_mac, sizeof(our_mac));
|
||||||
# ifdef HAVE_NET_DEVICE_OPS
|
# ifdef HAVE_NET_DEVICE_OPS
|
||||||
netdev->netdev_ops = &vb_netdev_ops;
|
netdev->netdev_ops = &vb_netdev_ops;
|
||||||
|
@ -394,22 +394,16 @@ struct wcdte {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef HAVE_NETDEV_PRIV
|
|
||||||
struct wcdte_netdev_priv {
|
struct wcdte_netdev_priv {
|
||||||
struct wcdte *wc;
|
struct wcdte *wc;
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline struct wcdte *
|
static inline struct wcdte *
|
||||||
wcdte_from_netdev(struct net_device *netdev)
|
wcdte_from_netdev(struct net_device *netdev)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_NETDEV_PRIV
|
|
||||||
struct wcdte_netdev_priv *priv;
|
struct wcdte_netdev_priv *priv;
|
||||||
priv = netdev_priv(netdev);
|
priv = netdev_priv(netdev);
|
||||||
return priv->wc;
|
return priv->wc;
|
||||||
#else
|
|
||||||
return netdev->priv;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -686,23 +680,14 @@ wctc4xxp_net_register(struct wcdte *wc)
|
|||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
struct net_device *netdev;
|
struct net_device *netdev;
|
||||||
# ifdef HAVE_NETDEV_PRIV
|
|
||||||
struct wcdte_netdev_priv *priv;
|
struct wcdte_netdev_priv *priv;
|
||||||
# endif
|
|
||||||
const char our_mac[] = { 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
|
const char our_mac[] = { 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
|
||||||
|
|
||||||
# ifdef HAVE_NETDEV_PRIV
|
|
||||||
netdev = alloc_netdev(sizeof(*priv), wc->board_name, ether_setup);
|
netdev = alloc_netdev(sizeof(*priv), wc->board_name, ether_setup);
|
||||||
if (!netdev)
|
if (!netdev)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
priv = netdev_priv(netdev);
|
priv = netdev_priv(netdev);
|
||||||
priv->wc = wc;
|
priv->wc = wc;
|
||||||
# else
|
|
||||||
netdev = alloc_netdev(0, wc->board_name, ether_setup);
|
|
||||||
if (!netdev)
|
|
||||||
return -ENOMEM;
|
|
||||||
netdev->priv = wc;
|
|
||||||
# endif
|
|
||||||
memcpy(netdev->dev_addr, our_mac, sizeof(our_mac));
|
memcpy(netdev->dev_addr, our_mac, sizeof(our_mac));
|
||||||
|
|
||||||
# ifdef HAVE_NET_DEVICE_OPS
|
# ifdef HAVE_NET_DEVICE_OPS
|
||||||
|
Loading…
Reference in New Issue
Block a user