Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278701
b: refs/heads/master
c: f79f890
h: refs/heads/master
i:
  278699: 99759aa
v: v3
  • Loading branch information
Felipe Balbi authored and Luciano Coelho committed Oct 11, 2011
1 parent 0b2c405 commit ff86bb3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 76 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4b32a2c9a636eaab69c797d9ebc7e086a6bd2fb7
refs/heads/master: f79f890c9ccd8d10f7e5e2f7c590b0c2e854bfb6
104 changes: 30 additions & 74 deletions trunk/drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,22 +383,6 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl,
static void wl1271_op_stop(struct ieee80211_hw *hw);
static void wl1271_free_ap_keys(struct wl1271 *wl, struct wl12xx_vif *wlvif);


static void wl1271_device_release(struct device *dev)
{

}

static struct platform_device wl1271_device = {
.name = "wl1271",
.id = -1,

/* device model insists to have a release function */
.dev = {
.release = wl1271_device_release,
},
};

static DEFINE_MUTEX(wl_list_mutex);
static LIST_HEAD(wl_list);

Expand Down Expand Up @@ -4992,7 +4976,6 @@ static int wl1271_init_ieee80211(struct wl1271 *wl)
static struct ieee80211_hw *wl1271_alloc_hw(void)
{
struct ieee80211_hw *hw;
struct platform_device *plat_dev = NULL;
struct wl1271 *wl;
int i, j, ret;
unsigned int order;
Expand All @@ -5006,21 +4989,13 @@ static struct ieee80211_hw *wl1271_alloc_hw(void)
goto err_hw_alloc;
}

plat_dev = kmemdup(&wl1271_device, sizeof(wl1271_device), GFP_KERNEL);
if (!plat_dev) {
wl1271_error("could not allocate platform_device");
ret = -ENOMEM;
goto err_plat_alloc;
}

wl = hw->priv;
memset(wl, 0, sizeof(*wl));

INIT_LIST_HEAD(&wl->list);
INIT_LIST_HEAD(&wl->wlvif_list);

wl->hw = hw;
wl->plat_dev = plat_dev;

for (i = 0; i < NUM_TX_QUEUES; i++)
for (j = 0; j < WL12XX_MAX_LINKS; j++)
Expand Down Expand Up @@ -5095,49 +5070,8 @@ static struct ieee80211_hw *wl1271_alloc_hw(void)
goto err_dummy_packet;
}

/* Register platform device */
ret = platform_device_register(wl->plat_dev);
if (ret) {
wl1271_error("couldn't register platform device");
goto err_fwlog;
}
dev_set_drvdata(&wl->plat_dev->dev, wl);

/* Create sysfs file to control bt coex state */
ret = device_create_file(&wl->plat_dev->dev, &dev_attr_bt_coex_state);
if (ret < 0) {
wl1271_error("failed to create sysfs file bt_coex_state");
goto err_platform;
}

/* Create sysfs file to get HW PG version */
ret = device_create_file(&wl->plat_dev->dev, &dev_attr_hw_pg_ver);
if (ret < 0) {
wl1271_error("failed to create sysfs file hw_pg_ver");
goto err_bt_coex_state;
}

/* Create sysfs file for the FW log */
ret = device_create_bin_file(&wl->plat_dev->dev, &fwlog_attr);
if (ret < 0) {
wl1271_error("failed to create sysfs file fwlog");
goto err_hw_pg_ver;
}

return hw;

err_hw_pg_ver:
device_remove_file(&wl->plat_dev->dev, &dev_attr_hw_pg_ver);

err_bt_coex_state:
device_remove_file(&wl->plat_dev->dev, &dev_attr_bt_coex_state);

err_platform:
platform_device_unregister(wl->plat_dev);

err_fwlog:
free_page((unsigned long)wl->fwlog);

err_dummy_packet:
dev_kfree_skb(wl->dummy_packet);

Expand All @@ -5149,9 +5083,6 @@ static struct ieee80211_hw *wl1271_alloc_hw(void)

err_hw:
wl1271_debugfs_exit(wl);
kfree(plat_dev);

err_plat_alloc:
ieee80211_free_hw(hw);

err_hw_alloc:
Expand All @@ -5167,17 +5098,15 @@ static int wl1271_free_hw(struct wl1271 *wl)
wake_up_interruptible_all(&wl->fwlog_waitq);
mutex_unlock(&wl->mutex);

device_remove_bin_file(&wl->plat_dev->dev, &fwlog_attr);
device_remove_bin_file(wl->dev, &fwlog_attr);

device_remove_file(&wl->plat_dev->dev, &dev_attr_hw_pg_ver);
device_remove_file(wl->dev, &dev_attr_hw_pg_ver);

device_remove_file(&wl->plat_dev->dev, &dev_attr_bt_coex_state);
platform_device_unregister(wl->plat_dev);
device_remove_file(wl->dev, &dev_attr_bt_coex_state);
free_page((unsigned long)wl->fwlog);
dev_kfree_skb(wl->dummy_packet);
free_pages((unsigned long)wl->aggr_buf,
get_order(WL1271_AGGR_BUFFER_SIZE));
kfree(wl->plat_dev);

wl1271_debugfs_exit(wl);

Expand Down Expand Up @@ -5281,8 +5210,35 @@ static int __devinit wl12xx_probe(struct platform_device *pdev)
if (ret)
goto out_irq;

/* Create sysfs file to control bt coex state */
ret = device_create_file(wl->dev, &dev_attr_bt_coex_state);
if (ret < 0) {
wl1271_error("failed to create sysfs file bt_coex_state");
goto out_irq;
}

/* Create sysfs file to get HW PG version */
ret = device_create_file(wl->dev, &dev_attr_hw_pg_ver);
if (ret < 0) {
wl1271_error("failed to create sysfs file hw_pg_ver");
goto out_bt_coex_state;
}

/* Create sysfs file for the FW log */
ret = device_create_bin_file(wl->dev, &fwlog_attr);
if (ret < 0) {
wl1271_error("failed to create sysfs file fwlog");
goto out_hw_pg_ver;
}

return 0;

out_hw_pg_ver:
device_remove_file(wl->dev, &dev_attr_hw_pg_ver);

out_bt_coex_state:
device_remove_file(wl->dev, &dev_attr_bt_coex_state);

out_irq:
free_irq(wl->irq, wl);

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/wl12xx/wl12xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ struct wl1271_link {
};

struct wl1271 {
struct platform_device *plat_dev;
struct ieee80211_hw *hw;
bool mac80211_registered;

Expand Down

0 comments on commit ff86bb3

Please sign in to comment.