Skip to content

Commit

Permalink
libertas: sysfs interface for accessing non-volatile configuration
Browse files Browse the repository at this point in the history
This will create the following sysfs directories:
/sys/class/net/mshX
		...
		|-- boot_options
		|   |-- bootflag
		|   `-- boottime
		...
		|-- mesh_ie
		|   |-- capability
		|   |-- mesh_id
		|   |-- metric_id
		|   `-- protocol_id

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Javier Cardona authored and John W. Linville committed May 22, 2008
1 parent edaea5c commit 15dbaac
Show file tree
Hide file tree
Showing 5 changed files with 423 additions and 9 deletions.
8 changes: 2 additions & 6 deletions drivers/net/wireless/libertas/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
libertas-objs := main.o wext.o \
rx.o tx.o cmd.o \
cmdresp.o scan.o \
11d.o \
debugfs.o \
ethtool.o assoc.o
libertas-objs := main.o wext.o rx.o tx.o cmd.o cmdresp.o scan.o 11d.o \
debugfs.o persistcfg.o ethtool.o assoc.o

usb8xxx-objs += if_usb.o
libertas_cs-objs += if_cs.o
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/wireless/libertas/decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ void lbs_mac_event_disconnected(struct lbs_private *priv);

void lbs_send_iwevcustom_event(struct lbs_private *priv, s8 *str);

/* persistcfg.c */
void lbs_persist_config_init(struct net_device *net);
void lbs_persist_config_remove(struct net_device *net);

/* main.c */
struct chan_freq_power *lbs_get_region_cfp_table(u8 region,
int *cfp_no);
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/wireless/libertas/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#define LBS_DEB_THREAD 0x00100000
#define LBS_DEB_HEX 0x00200000
#define LBS_DEB_SDIO 0x00400000
#define LBS_DEB_SYSFS 0x00800000

extern unsigned int lbs_debug;

Expand Down Expand Up @@ -81,7 +82,8 @@ do { if ((lbs_debug & (grp)) == (grp)) \
#define lbs_deb_usbd(dev, fmt, args...) LBS_DEB_LL(LBS_DEB_USB, " usbd", "%s:" fmt, (dev)->bus_id, ##args)
#define lbs_deb_cs(fmt, args...) LBS_DEB_LL(LBS_DEB_CS, " cs", fmt, ##args)
#define lbs_deb_thread(fmt, args...) LBS_DEB_LL(LBS_DEB_THREAD, " thread", fmt, ##args)
#define lbs_deb_sdio(fmt, args...) LBS_DEB_LL(LBS_DEB_SDIO, " thread", fmt, ##args)
#define lbs_deb_sdio(fmt, args...) LBS_DEB_LL(LBS_DEB_SDIO, " sdio", fmt, ##args)
#define lbs_deb_sysfs(fmt, args...) LBS_DEB_LL(LBS_DEB_SYSFS, " sysfs", fmt, ##args)

#define lbs_pr_info(format, args...) \
printk(KERN_INFO DRV_NAME": " format, ## args)
Expand Down
8 changes: 6 additions & 2 deletions drivers/net/wireless/libertas/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1302,8 +1302,9 @@ void lbs_stop_card(struct lbs_private *priv)

lbs_debugfs_remove_one(priv);
device_remove_file(&dev->dev, &dev_attr_lbs_rtap);
if (priv->mesh_tlv)
if (priv->mesh_tlv) {
device_remove_file(&dev->dev, &dev_attr_lbs_mesh);
}

/* Flush pending command nodes */
del_timer_sync(&priv->command_timer);
Expand Down Expand Up @@ -1372,6 +1373,8 @@ static int lbs_add_mesh(struct lbs_private *priv)
if (ret)
goto err_unregister;

lbs_persist_config_init(mesh_dev);

/* Everything successful */
ret = 0;
goto done;
Expand All @@ -1398,8 +1401,9 @@ static void lbs_remove_mesh(struct lbs_private *priv)

lbs_deb_enter(LBS_DEB_MESH);
netif_stop_queue(mesh_dev);
netif_carrier_off(priv->mesh_dev);
netif_carrier_off(mesh_dev);
sysfs_remove_group(&(mesh_dev->dev.kobj), &lbs_mesh_attr_group);
lbs_persist_config_remove(mesh_dev);
unregister_netdev(mesh_dev);
priv->mesh_dev = NULL;
free_netdev(mesh_dev);
Expand Down
Loading

0 comments on commit 15dbaac

Please sign in to comment.