Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290399
b: refs/heads/master
c: 1ebbc48
h: refs/heads/master
i:
  290397: 6477dbc
  290395: 4c663a1
  290391: f11f6bd
  290383: 27d01e2
  290367: d9892f0
v: v3
  • Loading branch information
Gertjan van Wingerde authored and John W. Linville committed Feb 8, 2012
1 parent a66ab43 commit 41d0063
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 234f6e5c05277c0198797553434e2ed5acac18cc
refs/heads/master: 1ebbc48520a0853cd4d812d8342f9886b2b07b92
6 changes: 6 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00.h
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ struct rt2x00lib_ops {
*/
struct rt2x00_ops {
const char *name;
const unsigned int drv_data_size;
const unsigned int max_sta_intf;
const unsigned int max_ap_intf;
const unsigned int eeprom_size;
Expand Down Expand Up @@ -741,6 +742,11 @@ struct rt2x00_dev {
*/
const struct rt2x00_ops *ops;

/*
* Driver data.
*/
void *drv_data;

/*
* IEEE80211 control structure.
*/
Expand Down
18 changes: 18 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,18 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
{
int retval = -ENOMEM;

/*
* Allocate the driver data memory, if necessary.
*/
if (rt2x00dev->ops->drv_data_size > 0) {
rt2x00dev->drv_data = kzalloc(rt2x00dev->ops->drv_data_size,
GFP_KERNEL);
if (!rt2x00dev->drv_data) {
retval = -ENOMEM;
goto exit;
}
}

spin_lock_init(&rt2x00dev->irqmask_lock);
mutex_init(&rt2x00dev->csr_mutex);

Expand Down Expand Up @@ -1261,6 +1273,12 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
* Free queue structures.
*/
rt2x00queue_free(rt2x00dev);

/*
* Free the driver data.
*/
if (rt2x00dev->drv_data)
kfree(rt2x00dev->drv_data);
}
EXPORT_SYMBOL_GPL(rt2x00lib_remove_dev);

Expand Down

0 comments on commit 41d0063

Please sign in to comment.