int lbs_set_iface_type(struct lbs_private *priv, enum nl80211_iftype type)
{ int ret = 0;
switch (type) { case NL80211_IFTYPE_MONITOR:
ret = lbs_set_monitor_mode(priv, 1); break; case NL80211_IFTYPE_STATION: if (priv->wdev->iftype == NL80211_IFTYPE_MONITOR)
ret = lbs_set_monitor_mode(priv, 0); if (!ret)
ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_BSS_TYPE, 1); break; case NL80211_IFTYPE_ADHOC: if (priv->wdev->iftype == NL80211_IFTYPE_MONITOR)
ret = lbs_set_monitor_mode(priv, 0); if (!ret)
ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_BSS_TYPE, 2); break; default:
ret = -ENOTSUPP;
} return ret;
}
int lbs_start_iface(struct lbs_private *priv)
{ struct cmd_ds_802_11_mac_address cmd; int ret;
if (priv->power_restore) {
ret = priv->power_restore(priv); if (ret) return ret;
}
/* Disable command processing, and wait for all commands to complete */
lbs_deb_main("waiting for commands to complete\n");
wait_event(priv->waitq, lbs_command_queue_empty(priv));
lbs_deb_main("all commands completed\n");
if (priv->power_save)
ret = priv->power_save(priv);
int lbs_set_mac_address(struct net_device *dev, void *addr)
{ int ret = 0; struct lbs_private *priv = dev->ml_priv; struct sockaddr *phwaddr = addr;
/* *CanonlysetMACaddresswhenallinterfacesaredown,tobewritten *tothehardwarewhenoneofthemisbroughtup.
*/ if (lbs_iface_active(priv)) return -EBUSY;
/* In case it was called from the mesh device */
dev = priv->dev;
memcpy(priv->current_addr, phwaddr->sa_data, ETH_ALEN);
eth_hw_addr_set(dev, phwaddr->sa_data); if (priv->mesh_dev)
eth_hw_addr_set(priv->mesh_dev, phwaddr->sa_data);
return ret;
}
staticinlineint mac_in_list(unsignedchar *list, int list_len, unsignedchar *mac)
{ while (list_len) { if (!memcmp(list, mac, ETH_ALEN)) return1;
list += ETH_ALEN;
list_len--;
} return0;
}
staticint lbs_add_mcast_addrs(struct cmd_ds_mac_multicast_adr *cmd, struct net_device *dev, int nr_addrs)
{ int i = nr_addrs; struct netdev_hw_addr *ha; int cnt;
if ((dev->flags & (IFF_UP|IFF_MULTICAST)) != (IFF_UP|IFF_MULTICAST)) return nr_addrs;
/* Once for priv->dev, again for priv->mesh_dev if it exists */
nr_addrs = lbs_add_mcast_addrs(&mcast_cmd, priv->dev, 0); if (nr_addrs >= 0 && priv->mesh_dev)
nr_addrs = lbs_add_mcast_addrs(&mcast_cmd, priv->mesh_dev, nr_addrs); if (nr_addrs < 0) goto do_allmulti;
if (nr_addrs) { int size = offsetof(struct cmd_ds_mac_multicast_adr,
maclist[6*nr_addrs]);
if (kthread_should_stop())
shouldsleep = 0; /* Bye */ elseif (priv->surpriseremoved)
shouldsleep = 1; /* We need to wait until we're _told_ to die */ elseif (priv->psstate == PS_STATE_SLEEP)
shouldsleep = 1; /* Sleep mode. Nothing we can do till it wakes */ elseif (priv->cmd_timed_out)
shouldsleep = 0; /* Command timed out. Recover */ elseif (!priv->fw_ready)
shouldsleep = 1; /* Firmware not ready. We're waiting for it */ elseif (priv->dnld_sent)
shouldsleep = 1; /* Something is en route to the device already */ elseif (priv->tx_pending_len > 0)
shouldsleep = 0; /* We've a packet to send */ elseif (priv->resp_len[priv->resp_idx])
shouldsleep = 0; /* We have a command response */ elseif (priv->cur_cmd)
shouldsleep = 1; /* Can't send a command; one already running */ elseif (!list_empty(&priv->cmdpendingq))
shouldsleep = 0; /* We have a command to send */ elseif (kfifo_len(&priv->event_fifo))
shouldsleep = 0; /* We have an event to process */ else
shouldsleep = 1; /* No command */
/* Reset card, but only when it isn't in the process
* of being shutdown anyway. */ if (!dev->dismantle && priv->reset_card)
priv->reset_card(priv);
}
priv->cmd_timed_out = 0;
if (!priv->fw_ready) continue;
/* Check if we need to confirm Sleep Request received previously */ if (priv->psstate == PS_STATE_PRE_SLEEP &&
!priv->dnld_sent && !priv->cur_cmd) { if (priv->connect_status == LBS_CONNECTED) {
lbs_deb_thread("pre-sleep, currenttxskb %p, " "dnld_sent %d, cur_cmd %p\n",
priv->currenttxskb, priv->dnld_sent,
priv->cur_cmd);
/* The PS state is changed during processing of Sleep Request *eventabove
*/ if ((priv->psstate == PS_STATE_SLEEP) ||
(priv->psstate == PS_STATE_PRE_SLEEP)) continue;
if (priv->is_deep_sleep) continue;
/* Execute the next command */ if (!priv->dnld_sent && !priv->cur_cmd)
lbs_execute_next_command(priv);
spin_lock_irq(&priv->driver_lock); if (!priv->dnld_sent && priv->tx_pending_len > 0) { int ret = priv->hw_host_to_card(priv, MVMS_DAT,
priv->tx_pending_buf,
priv->tx_pending_len); if (ret) {
lbs_deb_tx("host_to_card failed %d\n", ret);
priv->dnld_sent = DNLD_RES_RECEIVED;
} else {
mod_timer(&priv->tx_lockup_timer,
jiffies + (HZ * 5));
}
priv->tx_pending_len = 0; if (!priv->currenttxskb) { /* We can wake the queues immediately if we aren't
waiting for TX feedback */ if (priv->connect_status == LBS_CONNECTED)
netif_wake_queue(priv->dev); if (priv->mesh_dev &&
netif_running(priv->mesh_dev))
netif_wake_queue(priv->mesh_dev);
}
}
spin_unlock_irq(&priv->driver_lock);
}
if (priv->wiphy_registered)
lbs_scan_deinit(priv);
lbs_wait_for_firmware_load(priv);
/* worker thread destruction blocks on the in-flight command which *shouldhavebeenclearedalreadyinlbs_stop_card().
*/
lbs_deb_main("destroying worker thread\n");
destroy_workqueue(priv->work_thread);
lbs_deb_main("done destroying worker thread\n");
if (priv->psmode == LBS802_11POWERMODEMAX_PSP) {
priv->psmode = LBS802_11POWERMODECAM; /* no need to wakeup if already woken up, *onsuspend,thisexitpscommandisnotprocessed *thedriverhangs
*/ if (priv->psstate != PS_STATE_FULL_POWER)
lbs_set_ps_mode(priv, PS_MODE_ACTION_EXIT_PS, true);
}
if (priv->is_deep_sleep) {
priv->is_deep_sleep = 0;
wake_up_interruptible(&priv->ds_awake_q);
}
/* If the netdev isn't registered, it means that lbs_start_card() was
* never called so we have nothing to do here. */ if (dev->reg_state != NETREG_REGISTERED) return;
MODULE_DESCRIPTION("Libertas WLAN Driver Library");
MODULE_AUTHOR("Marvell International Ltd.");
MODULE_LICENSE("GPL");
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.19Bemerkung:
(vorverarbeitet am 2026-10-12)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.