Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  rfkill.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Linux RFKILL support for RTL8187
 *
 * Copyright (c) 2009 Herton Ronaldo Krzesinski <herton@mandriva.com.br>
 *
 * Based on the RFKILL handling in the r8187 driver, which is:
 * Copyright (c) Realtek Semiconductor Corp. All rights reserved.
 *
 * Thanks to Realtek for their support!
 */


#include <linux/types.h>
#include <linux/usb.h>
#include <net/mac80211.h>

#include "rtl8187.h"
#include "rfkill.h"

static bool rtl8187_is_radio_enabled(struct rtl8187_priv *priv)
{
 u8 gpio;

 gpio = rtl818x_ioread8(priv, &priv->map->GPIO0);
 rtl818x_iowrite8(priv, &priv->map->GPIO0, gpio & ~priv->rfkill_mask);
 gpio = rtl818x_ioread8(priv, &priv->map->GPIO1);

 return gpio & priv->rfkill_mask;
}

void rtl8187_rfkill_init(struct ieee80211_hw *hw)
{
 struct rtl8187_priv *priv = hw->priv;

 priv->rfkill_off = rtl8187_is_radio_enabled(priv);
 printk(KERN_INFO "rtl8187: wireless switch is %s\n",
        priv->rfkill_off ? "on" : "off");
 wiphy_rfkill_set_hw_state(hw->wiphy, !priv->rfkill_off);
 wiphy_rfkill_start_polling(hw->wiphy);
}

void rtl8187_rfkill_poll(struct ieee80211_hw *hw)
{
 bool enabled;
 struct rtl8187_priv *priv = hw->priv;

 mutex_lock(&priv->conf_mutex);
 enabled = rtl8187_is_radio_enabled(priv);
 if (unlikely(enabled != priv->rfkill_off)) {
  priv->rfkill_off = enabled;
  printk(KERN_INFO "rtl8187: wireless radio switch turned %s\n",
         enabled ? "on" : "off");
  wiphy_rfkill_set_hw_state(hw->wiphy, !enabled);
 }
 mutex_unlock(&priv->conf_mutex);
}

void rtl8187_rfkill_exit(struct ieee80211_hw *hw)
{
 wiphy_rfkill_stop_polling(hw->wiphy);
}

Messung V0.5
C=94 H=92 G=92

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge