* [PATCH 0/3] wifi: iwlegacy: remove undocumented sysfs files
@ 2026-10-06 8:14 stf_xl
2026-10-06 8:14 ` [PATCH 1/3] wifi: iwlegacy: set debug level using debugfs stf_xl
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: stf_xl @ 2026-10-06 8:14 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg
From: Stanislaw Gruszka <stf_xl@wp.pl>
Remove custom undocumented sysfs files. All are seems unneeded
at this point, except debug_level which is useful for dynamically
change debug mask. That one was moved to debugfs.
Stanislaw Gruszka (3):
wifi: iwlegacy: set debug level using debugfs
wifi: iwlegacy: 4965: remove custom sysfs files
wifi: iwlegacy: 3945: remove custom sysfs files
.../net/wireless/intel/iwlegacy/3945-mac.c | 441 +-----------------
.../net/wireless/intel/iwlegacy/4965-mac.c | 121 -----
drivers/net/wireless/intel/iwlegacy/debug.c | 3 +
3 files changed, 5 insertions(+), 560 deletions(-)
--
2.50.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] wifi: iwlegacy: set debug level using debugfs
2026-10-06 8:14 [PATCH 0/3] wifi: iwlegacy: remove undocumented sysfs files stf_xl
@ 2026-10-06 8:14 ` stf_xl
2026-10-06 8:14 ` [PATCH 2/3] wifi: iwlegacy: 4965: remove custom sysfs files stf_xl
2026-10-06 8:14 ` [PATCH 3/3] wifi: iwlegacy: 3945: " stf_xl
2 siblings, 0 replies; 4+ messages in thread
From: stf_xl @ 2026-10-06 8:14 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg
From: Stanislaw Gruszka <stf_xl@wp.pl>
Instead of custom sysfs file use debugfs for setting/reading
debug level. Use hex only format since 'level' is actually a mask.
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
---
.../net/wireless/intel/iwlegacy/3945-mac.c | 46 -------------------
.../net/wireless/intel/iwlegacy/4965-mac.c | 46 -------------------
drivers/net/wireless/intel/iwlegacy/debug.c | 3 ++
3 files changed, 3 insertions(+), 92 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
index cbaf250626c5..aec45bcc2446 100644
--- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
@@ -3010,49 +3010,6 @@ il3945_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
*
*****************************************************************************/
-#ifdef CONFIG_IWLEGACY_DEBUG
-
-/*
- * The following adds a new attribute to the sysfs representation
- * of this device driver (i.e. a new file in /sys/bus/pci/drivers/iwl/)
- * used for controlling the debug level.
- *
- * See the level definitions in iwl for details.
- *
- * The debug_level being managed using sysfs below is a per device debug
- * level that is used instead of the global debug level if it (the per
- * device debug level) is set.
- */
-static ssize_t
-il3945_show_debug_level(struct device *d, struct device_attribute *attr,
- char *buf)
-{
- struct il_priv *il = dev_get_drvdata(d);
- return sprintf(buf, "0x%08X\n", il_get_debug_level(il));
-}
-
-static ssize_t
-il3945_store_debug_level(struct device *d, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct il_priv *il = dev_get_drvdata(d);
- unsigned long val;
- int ret;
-
- ret = kstrtoul(buf, 0, &val);
- if (ret)
- IL_INFO("%s is not in hex or decimal form.\n", buf);
- else
- il->debug_level = val;
-
- return strnlen(buf, count);
-}
-
-static DEVICE_ATTR(debug_level, 0644, il3945_show_debug_level,
- il3945_store_debug_level);
-
-#endif /* CONFIG_IWLEGACY_DEBUG */
-
static ssize_t
il3945_show_temperature(struct device *d, struct device_attribute *attr,
char *buf)
@@ -3385,9 +3342,6 @@ static struct attribute *il3945_sysfs_entries[] = {
&dev_attr_status.attr,
&dev_attr_temperature.attr,
&dev_attr_tx_power.attr,
-#ifdef CONFIG_IWLEGACY_DEBUG
- &dev_attr_debug_level.attr,
-#endif
NULL
};
diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
index 18bb55682643..dc420366dff3 100644
--- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
@@ -4526,49 +4526,6 @@ il4965_irq_tasklet(struct tasklet_struct *t)
*
*****************************************************************************/
-#ifdef CONFIG_IWLEGACY_DEBUG
-
-/*
- * The following adds a new attribute to the sysfs representation
- * of this device driver (i.e. a new file in /sys/class/net/wlan0/device/)
- * used for controlling the debug level.
- *
- * See the level definitions in iwl for details.
- *
- * The debug_level being managed using sysfs below is a per device debug
- * level that is used instead of the global debug level if it (the per
- * device debug level) is set.
- */
-static ssize_t
-il4965_show_debug_level(struct device *d, struct device_attribute *attr,
- char *buf)
-{
- struct il_priv *il = dev_get_drvdata(d);
- return sprintf(buf, "0x%08X\n", il_get_debug_level(il));
-}
-
-static ssize_t
-il4965_store_debug_level(struct device *d, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct il_priv *il = dev_get_drvdata(d);
- unsigned long val;
- int ret;
-
- ret = kstrtoul(buf, 0, &val);
- if (ret)
- IL_ERR("%s is not in hex or decimal form.\n", buf);
- else
- il->debug_level = val;
-
- return strnlen(buf, count);
-}
-
-static DEVICE_ATTR(debug_level, 0644, il4965_show_debug_level,
- il4965_store_debug_level);
-
-#endif /* CONFIG_IWLEGACY_DEBUG */
-
static ssize_t
il4965_show_temperature(struct device *d, struct device_attribute *attr,
char *buf)
@@ -4623,9 +4580,6 @@ static DEVICE_ATTR(tx_power, 0644, il4965_show_tx_power,
static struct attribute *il_sysfs_entries[] = {
&dev_attr_temperature.attr,
&dev_attr_tx_power.attr,
-#ifdef CONFIG_IWLEGACY_DEBUG
- &dev_attr_debug_level.attr,
-#endif
NULL
};
diff --git a/drivers/net/wireless/intel/iwlegacy/debug.c b/drivers/net/wireless/intel/iwlegacy/debug.c
index 8a9f79ff1c6e..6f95961037d1 100644
--- a/drivers/net/wireless/intel/iwlegacy/debug.c
+++ b/drivers/net/wireless/intel/iwlegacy/debug.c
@@ -1361,6 +1361,9 @@ il_dbgfs_register(struct il_priv *il, const char *name)
DEBUGFS_ADD_BOOL(disable_chain_noise, dir_rf,
&il->disable_chain_noise_cal);
DEBUGFS_ADD_BOOL(disable_tx_power, dir_rf, &il->disable_tx_power_cal);
+#ifdef CONFIG_IWLEGACY_DEBUG
+ debugfs_create_x32("debug_level", 0600, dir_debug, &il->debug_level);
+#endif
}
EXPORT_SYMBOL(il_dbgfs_register);
--
2.50.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] wifi: iwlegacy: 4965: remove custom sysfs files
2026-10-06 8:14 [PATCH 0/3] wifi: iwlegacy: remove undocumented sysfs files stf_xl
2026-10-06 8:14 ` [PATCH 1/3] wifi: iwlegacy: set debug level using debugfs stf_xl
@ 2026-10-06 8:14 ` stf_xl
2026-10-06 8:14 ` [PATCH 3/3] wifi: iwlegacy: 3945: " stf_xl
2 siblings, 0 replies; 4+ messages in thread
From: stf_xl @ 2026-10-06 8:14 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg
From: Stanislaw Gruszka <stf_xl@wp.pl>
Remove undocumented sysfs files used for driver debugging and
development.
Given the age of the driver, it is highly unlikely that access to any
of this information is needed, but if so, proper debugfs entries can
be added.
Suggested-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
---
.../net/wireless/intel/iwlegacy/4965-mac.c | 75 -------------------
1 file changed, 75 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
index dc420366dff3..621a6ccdaaa6 100644
--- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
@@ -4520,74 +4520,6 @@ il4965_irq_tasklet(struct tasklet_struct *t)
#endif
}
-/*****************************************************************************
- *
- * sysfs attributes
- *
- *****************************************************************************/
-
-static ssize_t
-il4965_show_temperature(struct device *d, struct device_attribute *attr,
- char *buf)
-{
- struct il_priv *il = dev_get_drvdata(d);
-
- if (!il_is_alive(il))
- return -EAGAIN;
-
- return sprintf(buf, "%d\n", il->temperature);
-}
-
-static DEVICE_ATTR(temperature, 0444, il4965_show_temperature, NULL);
-
-static ssize_t
-il4965_show_tx_power(struct device *d, struct device_attribute *attr, char *buf)
-{
- struct il_priv *il = dev_get_drvdata(d);
-
- if (!il_is_ready_rf(il))
- return sprintf(buf, "off\n");
- else
- return sprintf(buf, "%d\n", il->tx_power_user_lmt);
-}
-
-static ssize_t
-il4965_store_tx_power(struct device *d, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct il_priv *il = dev_get_drvdata(d);
- unsigned long val;
- int ret;
-
- ret = kstrtoul(buf, 10, &val);
- if (ret)
- IL_INFO("%s is not in decimal form.\n", buf);
- else {
- mutex_lock(&il->mutex);
- ret = il_set_tx_power(il, val, false);
- mutex_unlock(&il->mutex);
- if (ret)
- IL_ERR("failed setting tx power (0x%08x).\n", ret);
- else
- ret = count;
- }
- return ret;
-}
-
-static DEVICE_ATTR(tx_power, 0644, il4965_show_tx_power,
- il4965_store_tx_power);
-
-static struct attribute *il_sysfs_entries[] = {
- &dev_attr_temperature.attr,
- &dev_attr_tx_power.attr,
- NULL
-};
-
-static const struct attribute_group il_attribute_group = {
- .name = NULL, /* put in device directory */
- .attrs = il_sysfs_entries,
-};
-
/******************************************************************************
*
* uCode download functions
@@ -4922,12 +4854,6 @@ il4965_ucode_callback(const struct firmware *ucode_raw, void *context)
il_dbgfs_register(il, DRV_NAME);
- err = sysfs_create_group(&il->pci_dev->dev.kobj, &il_attribute_group);
- if (err) {
- IL_ERR("failed to create sysfs device attributes\n");
- goto out_unbind;
- }
-
/* We have our copies now, allow OS release its copies */
release_firmware(ucode_raw);
complete(&il->_4965.firmware_loading_complete);
@@ -6653,7 +6579,6 @@ il4965_pci_remove(struct pci_dev *pdev)
D_INFO("*** UNLOAD DRIVER ***\n");
il_dbgfs_unregister(il);
- sysfs_remove_group(&pdev->dev.kobj, &il_attribute_group);
/* ieee80211_unregister_hw call wil cause il_mac_stop to
* be called and il4965_down since we are removing the device
--
2.50.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] wifi: iwlegacy: 3945: remove custom sysfs files
2026-10-06 8:14 [PATCH 0/3] wifi: iwlegacy: remove undocumented sysfs files stf_xl
2026-10-06 8:14 ` [PATCH 1/3] wifi: iwlegacy: set debug level using debugfs stf_xl
2026-10-06 8:14 ` [PATCH 2/3] wifi: iwlegacy: 4965: remove custom sysfs files stf_xl
@ 2026-10-06 8:14 ` stf_xl
2 siblings, 0 replies; 4+ messages in thread
From: stf_xl @ 2026-10-06 8:14 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg
From: Stanislaw Gruszka <stf_xl@wp.pl>
Remove undocumented sysfs files used for driver debugging and
development.
Given the age of the driver, it is highly unlikely that access to any
of this information is needed, but if so, proper debugfs entries can
be added.
Suggested-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
---
.../net/wireless/intel/iwlegacy/3945-mac.c | 395 +-----------------
1 file changed, 2 insertions(+), 393 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
index aec45bcc2446..604317b3dddc 100644
--- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
@@ -634,85 +634,6 @@ il3945_tx_skb(struct il_priv *il,
return -1;
}
-static int
-il3945_get_measurement(struct il_priv *il,
- struct ieee80211_measurement_params *params, u8 type)
-{
- struct il_spectrum_cmd spectrum;
- struct il_rx_pkt *pkt;
- struct il_host_cmd cmd = {
- .id = C_SPECTRUM_MEASUREMENT,
- .data = (void *)&spectrum,
- .flags = CMD_WANT_SKB,
- };
- u32 add_time = le64_to_cpu(params->start_time);
- int rc;
- int spectrum_resp_status;
- int duration = le16_to_cpu(params->duration);
-
- if (il_is_associated(il))
- add_time =
- il_usecs_to_beacons(il,
- le64_to_cpu(params->start_time) -
- il->_3945.last_tsf,
- le16_to_cpu(il->timing.beacon_interval));
-
- memset(&spectrum, 0, sizeof(spectrum));
-
- spectrum.channel_count = cpu_to_le16(1);
- spectrum.flags =
- RXON_FLG_TSF2HOST_MSK | RXON_FLG_ANT_A_MSK | RXON_FLG_DIS_DIV_MSK;
- spectrum.filter_flags = MEASUREMENT_FILTER_FLAG;
- cmd.len = sizeof(spectrum);
- spectrum.len = cpu_to_le16(cmd.len - sizeof(spectrum.len));
-
- if (il_is_associated(il))
- spectrum.start_time =
- il_add_beacon_time(il, il->_3945.last_beacon_time, add_time,
- le16_to_cpu(il->timing.beacon_interval));
- else
- spectrum.start_time = 0;
-
- spectrum.channels[0].duration = cpu_to_le32(duration * TIME_UNIT);
- spectrum.channels[0].channel = params->channel;
- spectrum.channels[0].type = type;
- if (il->active.flags & RXON_FLG_BAND_24G_MSK)
- spectrum.flags |=
- RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK |
- RXON_FLG_TGG_PROTECT_MSK;
-
- rc = il_send_cmd_sync(il, &cmd);
- if (rc)
- return rc;
-
- pkt = (struct il_rx_pkt *)cmd.reply_page;
- if (pkt->hdr.flags & IL_CMD_FAILED_MSK) {
- IL_ERR("Bad return from N_RX_ON_ASSOC command\n");
- rc = -EIO;
- }
-
- spectrum_resp_status = le16_to_cpu(pkt->u.spectrum.status);
- switch (spectrum_resp_status) {
- case 0: /* Command will be handled */
- if (pkt->u.spectrum.id != 0xff) {
- D_INFO("Replaced existing measurement: %d\n",
- pkt->u.spectrum.id);
- il->measurement_status &= ~MEASUREMENT_READY;
- }
- il->measurement_status |= MEASUREMENT_ACTIVE;
- rc = 0;
- break;
-
- case 1: /* Command will not be handled */
- rc = -EAGAIN;
- break;
- }
-
- il_free_pages(il, cmd.reply_page);
-
- return rc;
-}
-
static void
il3945_hdl_alive(struct il_priv *il, struct il_rx_buf *rxb)
{
@@ -3004,290 +2925,6 @@ il3945_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL;
}
-/*****************************************************************************
- *
- * sysfs attributes
- *
- *****************************************************************************/
-
-static ssize_t
-il3945_show_temperature(struct device *d, struct device_attribute *attr,
- char *buf)
-{
- struct il_priv *il = dev_get_drvdata(d);
-
- if (!il_is_alive(il))
- return -EAGAIN;
-
- return sprintf(buf, "%d\n", il3945_hw_get_temperature(il));
-}
-
-static DEVICE_ATTR(temperature, 0444, il3945_show_temperature, NULL);
-
-static ssize_t
-il3945_show_tx_power(struct device *d, struct device_attribute *attr, char *buf)
-{
- struct il_priv *il = dev_get_drvdata(d);
- return sprintf(buf, "%d\n", il->tx_power_user_lmt);
-}
-
-static ssize_t
-il3945_store_tx_power(struct device *d, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct il_priv *il = dev_get_drvdata(d);
- char *p = (char *)buf;
- u32 val;
-
- val = simple_strtoul(p, &p, 10);
- if (p == buf)
- IL_INFO(": %s is not in decimal form.\n", buf);
- else
- il3945_hw_reg_set_txpower(il, val);
-
- return count;
-}
-
-static DEVICE_ATTR(tx_power, 0644, il3945_show_tx_power, il3945_store_tx_power);
-
-static ssize_t
-il3945_show_flags(struct device *d, struct device_attribute *attr, char *buf)
-{
- struct il_priv *il = dev_get_drvdata(d);
-
- return sprintf(buf, "0x%04X\n", il->active.flags);
-}
-
-static ssize_t
-il3945_store_flags(struct device *d, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct il_priv *il = dev_get_drvdata(d);
- u32 flags = simple_strtoul(buf, NULL, 0);
-
- mutex_lock(&il->mutex);
- if (le32_to_cpu(il->staging.flags) != flags) {
- /* Cancel any currently running scans... */
- if (il_scan_cancel_timeout(il, 100))
- IL_WARN("Could not cancel scan.\n");
- else {
- D_INFO("Committing rxon.flags = 0x%04X\n", flags);
- il->staging.flags = cpu_to_le32(flags);
- il3945_commit_rxon(il);
- }
- }
- mutex_unlock(&il->mutex);
-
- return count;
-}
-
-static DEVICE_ATTR(flags, 0644, il3945_show_flags, il3945_store_flags);
-
-static ssize_t
-il3945_show_filter_flags(struct device *d, struct device_attribute *attr,
- char *buf)
-{
- struct il_priv *il = dev_get_drvdata(d);
-
- return sprintf(buf, "0x%04X\n", le32_to_cpu(il->active.filter_flags));
-}
-
-static ssize_t
-il3945_store_filter_flags(struct device *d, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct il_priv *il = dev_get_drvdata(d);
- u32 filter_flags = simple_strtoul(buf, NULL, 0);
-
- mutex_lock(&il->mutex);
- if (le32_to_cpu(il->staging.filter_flags) != filter_flags) {
- /* Cancel any currently running scans... */
- if (il_scan_cancel_timeout(il, 100))
- IL_WARN("Could not cancel scan.\n");
- else {
- D_INFO("Committing rxon.filter_flags = " "0x%04X\n",
- filter_flags);
- il->staging.filter_flags = cpu_to_le32(filter_flags);
- il3945_commit_rxon(il);
- }
- }
- mutex_unlock(&il->mutex);
-
- return count;
-}
-
-static DEVICE_ATTR(filter_flags, 0644, il3945_show_filter_flags,
- il3945_store_filter_flags);
-
-static ssize_t
-il3945_show_measurement(struct device *d, struct device_attribute *attr,
- char *buf)
-{
- struct il_priv *il = dev_get_drvdata(d);
- struct il_spectrum_notification measure_report;
- u32 size = sizeof(measure_report), len = 0, ofs = 0;
- u8 *data = (u8 *) &measure_report;
- unsigned long flags;
-
- spin_lock_irqsave(&il->lock, flags);
- if (!(il->measurement_status & MEASUREMENT_READY)) {
- spin_unlock_irqrestore(&il->lock, flags);
- return 0;
- }
- memcpy(&measure_report, &il->measure_report, size);
- il->measurement_status = 0;
- spin_unlock_irqrestore(&il->lock, flags);
-
- while (size && PAGE_SIZE - len) {
- hex_dump_to_buffer(data + ofs, size, 16, 1, buf + len,
- PAGE_SIZE - len, true);
- len = strlen(buf);
- if (PAGE_SIZE - len)
- buf[len++] = '\n';
-
- ofs += 16;
- size -= min(size, 16U);
- }
-
- return len;
-}
-
-static ssize_t
-il3945_store_measurement(struct device *d, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct il_priv *il = dev_get_drvdata(d);
- struct ieee80211_measurement_params params = {
- .channel = le16_to_cpu(il->active.channel),
- .start_time = cpu_to_le64(il->_3945.last_tsf),
- .duration = cpu_to_le16(1),
- };
- u8 type = IL_MEASURE_BASIC;
- u8 buffer[32];
- u8 channel;
-
- if (count) {
- char *p = buffer;
- strscpy(buffer, buf, sizeof(buffer));
- channel = simple_strtoul(p, NULL, 0);
- if (channel)
- params.channel = channel;
-
- p = buffer;
- while (*p && *p != ' ')
- p++;
- if (*p)
- type = simple_strtoul(p + 1, NULL, 0);
- }
-
- D_INFO("Invoking measurement of type %d on " "channel %d (for '%s')\n",
- type, params.channel, buf);
- mutex_lock(&il->mutex);
- il3945_get_measurement(il, ¶ms, type);
- mutex_unlock(&il->mutex);
-
- return count;
-}
-
-static DEVICE_ATTR(measurement, 0600, il3945_show_measurement,
- il3945_store_measurement);
-
-static ssize_t
-il3945_store_retry_rate(struct device *d, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct il_priv *il = dev_get_drvdata(d);
-
- il->retry_rate = simple_strtoul(buf, NULL, 0);
- if (il->retry_rate <= 0)
- il->retry_rate = 1;
-
- return count;
-}
-
-static ssize_t
-il3945_show_retry_rate(struct device *d, struct device_attribute *attr,
- char *buf)
-{
- struct il_priv *il = dev_get_drvdata(d);
- return sprintf(buf, "%d", il->retry_rate);
-}
-
-static DEVICE_ATTR(retry_rate, 0600, il3945_show_retry_rate,
- il3945_store_retry_rate);
-
-static ssize_t
-il3945_show_channels(struct device *d, struct device_attribute *attr, char *buf)
-{
- /* all this shit doesn't belong into sysfs anyway */
- return 0;
-}
-
-static DEVICE_ATTR(channels, 0400, il3945_show_channels, NULL);
-
-static ssize_t
-il3945_show_antenna(struct device *d, struct device_attribute *attr, char *buf)
-{
- struct il_priv *il = dev_get_drvdata(d);
-
- if (!il_is_alive(il))
- return -EAGAIN;
-
- return sprintf(buf, "%d\n", il3945_mod_params.antenna);
-}
-
-static ssize_t
-il3945_store_antenna(struct device *d, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct il_priv *il __maybe_unused = dev_get_drvdata(d);
- int ant;
-
- if (count == 0)
- return 0;
-
- if (sscanf(buf, "%1i", &ant) != 1) {
- D_INFO("not in hex or decimal form.\n");
- return count;
- }
-
- if (ant >= 0 && ant <= 2) {
- D_INFO("Setting antenna select to %d.\n", ant);
- il3945_mod_params.antenna = (enum il3945_antenna)ant;
- } else
- D_INFO("Bad antenna select value %d.\n", ant);
-
- return count;
-}
-
-static DEVICE_ATTR(antenna, 0644, il3945_show_antenna, il3945_store_antenna);
-
-static ssize_t
-il3945_show_status(struct device *d, struct device_attribute *attr, char *buf)
-{
- struct il_priv *il = dev_get_drvdata(d);
- if (!il_is_alive(il))
- return -EAGAIN;
- return sprintf(buf, "0x%08x\n", (int)il->status);
-}
-
-static DEVICE_ATTR(status, 0444, il3945_show_status, NULL);
-
-static ssize_t
-il3945_dump_error_log(struct device *d, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct il_priv *il = dev_get_drvdata(d);
- char *p = (char *)buf;
-
- if (p[0] == '1')
- il3945_dump_nic_error_log(il);
-
- return strnlen(buf, count);
-}
-
-static DEVICE_ATTR(dump_errors, 0200, NULL, il3945_dump_error_log);
-
/*****************************************************************************
*
* driver setup and tear down
@@ -3331,25 +2968,6 @@ il3945_cancel_deferred_work(struct il_priv *il)
il_cancel_scan_deferred_work(il);
}
-static struct attribute *il3945_sysfs_entries[] = {
- &dev_attr_antenna.attr,
- &dev_attr_channels.attr,
- &dev_attr_dump_errors.attr,
- &dev_attr_flags.attr,
- &dev_attr_filter_flags.attr,
- &dev_attr_measurement.attr,
- &dev_attr_retry_rate.attr,
- &dev_attr_status.attr,
- &dev_attr_temperature.attr,
- &dev_attr_tx_power.attr,
- NULL
-};
-
-static const struct attribute_group il3945_attribute_group = {
- .name = NULL, /* put in device directory */
- .attrs = il3945_sysfs_entries,
-};
-
static struct ieee80211_ops il3945_mac_ops __ro_after_init = {
.add_chanctx = ieee80211_emulate_add_chanctx,
.remove_chanctx = ieee80211_emulate_remove_chanctx,
@@ -3632,16 +3250,11 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto out_disable_msi;
}
- err = sysfs_create_group(&pdev->dev.kobj, &il3945_attribute_group);
- if (err) {
- IL_ERR("failed to create sysfs device attributes\n");
- goto out_release_irq;
- }
-
il_set_rxon_channel(il, &il->bands[NL80211_BAND_2GHZ].channels[5]);
+
err = il3945_setup_deferred_work(il);
if (err)
- goto out_remove_sysfs;
+ goto out_release_irq;
il3945_setup_handlers(il);
il_power_initialize(il);
@@ -3666,8 +3279,6 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
out_destroy_workqueue:
destroy_workqueue(il->workqueue);
il->workqueue = NULL;
-out_remove_sysfs:
- sysfs_remove_group(&pdev->dev.kobj, &il3945_attribute_group);
out_release_irq:
free_irq(il->pci_dev->irq, il);
out_disable_msi:
@@ -3732,8 +3343,6 @@ il3945_pci_remove(struct pci_dev *pdev)
il3945_synchronize_irq(il);
- sysfs_remove_group(&pdev->dev.kobj, &il3945_attribute_group);
-
cancel_delayed_work_sync(&il->_3945.rfkill_poll);
il3945_dealloc_ucode_pci(il);
--
2.50.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-10-06 8:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-06 8:14 [PATCH 0/3] wifi: iwlegacy: remove undocumented sysfs files stf_xl
2026-10-06 8:14 ` [PATCH 1/3] wifi: iwlegacy: set debug level using debugfs stf_xl
2026-10-06 8:14 ` [PATCH 2/3] wifi: iwlegacy: 4965: remove custom sysfs files stf_xl
2026-10-06 8:14 ` [PATCH 3/3] wifi: iwlegacy: 3945: " stf_xl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox