- /* At this point wlan_add_card() will be called. Don't worry
- * about keeping pwlanpriv around since it will be set on our
- * usb device data in -> add() -> libertas_sbi_register_dev().
- */
- if (!(pwlanpriv = wlan_add_card(usb_cardp)))
- goto dealloc;
+ if (!(priv = libertas_add_card(cardp, &udev->dev)))
+ goto err_prog_firmware;
+
+ cardp->priv = priv;
+
+ if (libertas_add_mesh(priv, &udev->dev))
+ goto err_add_mesh;
+
+ cardp->eth_dev = priv->dev;
+
+ priv->hw_host_to_card = if_usb_host_to_card;
+ priv->hw_get_int_status = if_usb_get_int_status;
+ priv->hw_read_event_cause = if_usb_read_event_cause;
+ priv->boot2_version = udev->descriptor.bcdDevice;
+
+ /* Delay 200 ms to waiting for the FW ready */
+ if_usb_submit_rx_urb(cardp);
+ msleep_interruptible(200);
+ priv->adapter->fw_ready = 1;
+
+ if (libertas_start_card(priv))
+ goto err_start_card;
+
+ list_add_tail(&cardp->list, &usb_devices);