X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fnet%2Fiseries_veth.c;h=2194b567239fcf502ebc7c42ee64f476e18a00be;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=cdc14401cdbeb6531941afcca376da99bb1769ca;hpb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;p=linux-2.6.git diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index cdc14401c..2194b5672 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c @@ -73,7 +73,7 @@ #include #include #include - +#include #include #include #include @@ -166,7 +166,7 @@ struct veth_msg { struct veth_lpar_connection { HvLpIndex remote_lp; - struct work_struct statemachine_wq; + struct delayed_work statemachine_wq; struct veth_msg *msgs; int num_events; struct veth_cap_data local_caps; @@ -456,7 +456,7 @@ static struct kobj_type veth_port_ktype = { static inline void veth_kick_statemachine(struct veth_lpar_connection *cnx) { - schedule_work(&cnx->statemachine_wq); + schedule_delayed_work(&cnx->statemachine_wq, 0); } static void veth_take_cap(struct veth_lpar_connection *cnx, @@ -586,7 +586,7 @@ static void veth_handle_int(struct veth_lpevent *event) }; } -static void veth_handle_event(struct HvLpEvent *event, struct pt_regs *regs) +static void veth_handle_event(struct HvLpEvent *event) { struct veth_lpevent *veth_event = (struct veth_lpevent *)event; @@ -638,9 +638,11 @@ static int veth_process_caps(struct veth_lpar_connection *cnx) } /* FIXME: The gotos here are a bit dubious */ -static void veth_statemachine(void *p) +static void veth_statemachine(struct work_struct *work) { - struct veth_lpar_connection *cnx = (struct veth_lpar_connection *)p; + struct veth_lpar_connection *cnx = + container_of(work, struct veth_lpar_connection, + statemachine_wq.work); int rlp = cnx->remote_lp; int rc; @@ -827,7 +829,7 @@ static int veth_init_connection(u8 rlp) cnx->remote_lp = rlp; spin_lock_init(&cnx->lock); - INIT_WORK(&cnx->statemachine_wq, veth_statemachine, cnx); + INIT_DELAYED_WORK(&cnx->statemachine_wq, veth_statemachine); init_timer(&cnx->ack_timer); cnx->ack_timer.function = veth_timed_ack; @@ -1029,7 +1031,7 @@ static u32 veth_get_link(struct net_device *dev) return 1; } -static struct ethtool_ops ops = { +static const struct ethtool_ops ops = { .get_drvinfo = veth_get_drvinfo, .get_settings = veth_get_settings, .get_link = veth_get_link, @@ -1666,7 +1668,7 @@ static struct vio_driver veth_driver = { * Module initialization/cleanup */ -void __exit veth_module_cleanup(void) +static void __exit veth_module_cleanup(void) { int i; struct veth_lpar_connection *cnx; @@ -1695,11 +1697,14 @@ void __exit veth_module_cleanup(void) } module_exit(veth_module_cleanup); -int __init veth_module_init(void) +static int __init veth_module_init(void) { int i; int rc; + if (!firmware_has_feature(FW_FEATURE_ISERIES)) + return -ENODEV; + this_lp = HvLpConfig_getLpIndex_outline(); for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) {