]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
netfront accel: Ensure hooks set if accelerator loads before first
authorKeir Fraser <keir@xensource.com>
Tue, 30 Oct 2007 17:32:56 +0000 (17:32 +0000)
committerKeir Fraser <keir@xensource.com>
Tue, 30 Oct 2007 17:32:56 +0000 (17:32 +0000)
network interface.
Signed-off-by <kmansley@solarflare.com>

drivers/xen/netfront/accel.c

index 4f6c340ae6f2d18ff1ddc0749ccd1590180d4dad..8e3bec3734d7a211663f54143cf9cf7a00cd8d61 100644 (file)
@@ -131,7 +131,8 @@ static void add_accelerator_vif(struct netfront_accelerator *accelerator,
  * 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 *frontend,
        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 netfront_info *np,
        }
 
        /* 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;
        }
@@ -451,7 +452,7 @@ int netfront_accelerator_loaded(int version, const char *frontend,
        DPRINTK("Couldn't find matching accelerator (%s)\n",
                frontend);
 
-       init_accelerator(frontend, &accelerator);
+       init_accelerator(frontend, &accelerator, hooks);
 
        spin_unlock_irqrestore(&accelerators_lock, flags);