From: Kieran Mansley Subject: [Patch 4/8] Netfront accelerator bug fixes Date: Tue, 30 Oct 2007 17:07:52 +0000 Message-ID: <1193764072.4223.116.camel@moonstone.uk.level5networks.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-U1EHDRh8yix3t9oZwowx" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=-U1EHDRh8yix3t9oZwowx Content-Type: text/plain Content-Transfer-Encoding: 7bit Ensure hooks set if accelerator loads before first network interface Signed-off-by diff -r 7f386cf89345 drivers/xen/netfront/accel.c --- a/drivers/xen/netfront/accel.c Fri Oct 26 13:56:56 2007 +0100 +++ b/drivers/xen/netfront/accel.c Fri Oct 26 13:58:14 2007 +0100 @@ -131,7 +131,8 @@ static void add_accelerator_vif(struct n * Initialise the state to track an accelerator plugin module. */ static int init_accelerator(const char *frontend, - struct netfront_accelerator **result) + struct netfront_accelerator **result, + struct netfront_accel_hooks *hooks) { struct netfront_accelerator *accelerator = kmalloc(sizeof(struct netfront_accelerator), GFP_KERNEL); @@ -154,7 +155,7 @@ static int init_accelerator(const char * INIT_LIST_HEAD(&accelerator->vif_states); spin_lock_init(&accelerator->vif_states_lock); - accelerator->hooks = NULL; + accelerator->hooks = hooks; accelerator->ready_for_probe = 1; accelerator->need_probe = NULL; @@ -278,7 +279,7 @@ int netfront_load_accelerator(struct net } /* Couldn't find it, so create a new one and load the module */ - if ((rc = init_accelerator(frontend, &accelerator)) < 0) { + if ((rc = init_accelerator(frontend, &accelerator, NULL)) < 0) { spin_unlock_irqrestore(&accelerators_lock, flags); return rc; } @@ -450,7 +451,7 @@ int netfront_accelerator_loaded(int vers DPRINTK("Couldn't find matching accelerator (%s)\n", frontend); - init_accelerator(frontend, &accelerator); + init_accelerator(frontend, &accelerator, hooks); spin_unlock_irqrestore(&accelerators_lock, flags); --=-U1EHDRh8yix3t9oZwowx Content-Disposition: attachment; filename=accel_initialise_hooks Content-Type: text/plain; name=accel_initialise_hooks; charset=UTF-8 Content-Transfer-Encoding: 7bit Ensure hooks set if accelerator loads before first network interface diff -r 7f386cf89345 drivers/xen/netfront/accel.c --- a/drivers/xen/netfront/accel.c Fri Oct 26 13:56:56 2007 +0100 +++ b/drivers/xen/netfront/accel.c Fri Oct 26 13:58:14 2007 +0100 @@ -131,7 +131,8 @@ static void add_accelerator_vif(struct n * Initialise the state to track an accelerator plugin module. */ static int init_accelerator(const char *frontend, - struct netfront_accelerator **result) + struct netfront_accelerator **result, + struct netfront_accel_hooks *hooks) { struct netfront_accelerator *accelerator = kmalloc(sizeof(struct netfront_accelerator), GFP_KERNEL); @@ -154,7 +155,7 @@ static int init_accelerator(const char * INIT_LIST_HEAD(&accelerator->vif_states); spin_lock_init(&accelerator->vif_states_lock); - accelerator->hooks = NULL; + accelerator->hooks = hooks; accelerator->ready_for_probe = 1; accelerator->need_probe = NULL; @@ -278,7 +279,7 @@ int netfront_load_accelerator(struct net } /* Couldn't find it, so create a new one and load the module */ - if ((rc = init_accelerator(frontend, &accelerator)) < 0) { + if ((rc = init_accelerator(frontend, &accelerator, NULL)) < 0) { spin_unlock_irqrestore(&accelerators_lock, flags); return rc; } @@ -450,7 +451,7 @@ int netfront_accelerator_loaded(int vers DPRINTK("Couldn't find matching accelerator (%s)\n", frontend); - init_accelerator(frontend, &accelerator); + init_accelerator(frontend, &accelerator, hooks); spin_unlock_irqrestore(&accelerators_lock, flags); --=-U1EHDRh8yix3t9oZwowx Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-U1EHDRh8yix3t9oZwowx--