Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35123
b: refs/heads/master
c: 73c1ac1
h: refs/heads/master
i:
  35121: 8b4bc0e
  35119: d1b733e
v: v3
  • Loading branch information
John W. Linville committed Aug 2, 2006
1 parent ba982a1 commit 73eedac
Show file tree
Hide file tree
Showing 9 changed files with 566 additions and 328 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: 4456403f5ed589aeecc4271bc09f4ade6eae8adc
refs/heads/master: 73c1ac1e3b6c989b9b5f7b2313ac590a1c3b6d6a
52 changes: 27 additions & 25 deletions trunk/drivers/net/wireless/bcm43xx/bcm43xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,12 @@ struct bcm43xx_phyinfo {
* This lock is only used by bcm43xx_phy_{un}lock()
*/
spinlock_t lock;

/* Firmware. */
const struct firmware *ucode;
const struct firmware *pcm;
const struct firmware *initvals0;
const struct firmware *initvals1;
};


Expand Down Expand Up @@ -593,12 +599,14 @@ struct bcm43xx_coreinfo {
u8 available:1,
enabled:1,
initialized:1;
/** core_id ID number */
u16 id;
/** core_rev revision number */
u8 rev;
/** Index number for _switch_core() */
u8 index;
/** core_id ID number */
u16 id;
/** Core-specific data. */
void *priv;
};

/* Additional information for each 80211 core. */
Expand Down Expand Up @@ -647,7 +655,10 @@ enum {
BCM43xx_STAT_RESTARTING, /* controller_restart() called. */
};
#define bcm43xx_status(bcm) atomic_read(&(bcm)->init_status)
#define bcm43xx_set_status(bcm, stat) atomic_set(&(bcm)->init_status, (stat))
#define bcm43xx_set_status(bcm, stat) do { \
atomic_set(&(bcm)->init_status, (stat)); \
smp_wmb(); \
} while (0)

/* *** THEORY OF LOCKING ***
*
Expand Down Expand Up @@ -721,10 +732,6 @@ struct bcm43xx_private {
struct bcm43xx_coreinfo core_80211[ BCM43xx_MAX_80211_CORES ];
/* Additional information, specific to the 80211 cores. */
struct bcm43xx_coreinfo_80211 core_80211_ext[ BCM43xx_MAX_80211_CORES ];
/* Index of the current 80211 core. If current_core is not
* an 80211 core, this is -1.
*/
int current_80211_core_idx;
/* Number of available 80211 cores. */
int nr_80211_available;

Expand All @@ -737,6 +744,8 @@ struct bcm43xx_private {
u32 irq_savedstate;
/* Link Quality calculation context. */
struct bcm43xx_noise_calculation noisecalc;
/* if > 0 MAC is suspended. if == 0 MAC is enabled. */
int mac_suspended;

/* Threshold values. */
//TODO: The RTS thr has to be _used_. Currently, it is only set via WX.
Expand All @@ -759,12 +768,6 @@ struct bcm43xx_private {
struct bcm43xx_key key[54];
u8 default_key_idx;

/* Firmware. */
const struct firmware *ucode;
const struct firmware *pcm;
const struct firmware *initvals0;
const struct firmware *initvals1;

/* Random Number Generator. */
struct hwrng rng;
char rng_name[20 + 1];
Expand Down Expand Up @@ -827,34 +830,33 @@ int bcm43xx_using_pio(struct bcm43xx_private *bcm)
* any of these functions.
*/
static inline
struct bcm43xx_coreinfo_80211 *
bcm43xx_current_80211_priv(struct bcm43xx_private *bcm)
{
assert(bcm->current_core->id == BCM43xx_COREID_80211);
return bcm->current_core->priv;
}
static inline
struct bcm43xx_pio * bcm43xx_current_pio(struct bcm43xx_private *bcm)
{
assert(bcm43xx_using_pio(bcm));
assert(bcm->current_80211_core_idx >= 0);
assert(bcm->current_80211_core_idx < BCM43xx_MAX_80211_CORES);
return &(bcm->core_80211_ext[bcm->current_80211_core_idx].pio);
return &(bcm43xx_current_80211_priv(bcm)->pio);
}
static inline
struct bcm43xx_dma * bcm43xx_current_dma(struct bcm43xx_private *bcm)
{
assert(!bcm43xx_using_pio(bcm));
assert(bcm->current_80211_core_idx >= 0);
assert(bcm->current_80211_core_idx < BCM43xx_MAX_80211_CORES);
return &(bcm->core_80211_ext[bcm->current_80211_core_idx].dma);
return &(bcm43xx_current_80211_priv(bcm)->dma);
}
static inline
struct bcm43xx_phyinfo * bcm43xx_current_phy(struct bcm43xx_private *bcm)
{
assert(bcm->current_80211_core_idx >= 0);
assert(bcm->current_80211_core_idx < BCM43xx_MAX_80211_CORES);
return &(bcm->core_80211_ext[bcm->current_80211_core_idx].phy);
return &(bcm43xx_current_80211_priv(bcm)->phy);
}
static inline
struct bcm43xx_radioinfo * bcm43xx_current_radio(struct bcm43xx_private *bcm)
{
assert(bcm->current_80211_core_idx >= 0);
assert(bcm->current_80211_core_idx < BCM43xx_MAX_80211_CORES);
return &(bcm->core_80211_ext[bcm->current_80211_core_idx].radio);
return &(bcm43xx_current_80211_priv(bcm)->radio);
}


Expand Down
46 changes: 46 additions & 0 deletions trunk/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,42 @@ static ssize_t txstat_read_file(struct file *file, char __user *userbuf,
return res;
}

static ssize_t restart_write_file(struct file *file, const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct bcm43xx_private *bcm = file->private_data;
char *buf = really_big_buffer;
ssize_t buf_size;
ssize_t res;
unsigned long flags;

buf_size = min(count, sizeof (really_big_buffer) - 1);
down(&big_buffer_sem);
if (copy_from_user(buf, user_buf, buf_size)) {
res = -EFAULT;
goto out_up;
}
mutex_lock(&(bcm)->mutex);
spin_lock_irqsave(&(bcm)->irq_lock, flags);
if (bcm43xx_status(bcm) != BCM43xx_STAT_INITIALIZED) {
printk(KERN_INFO PFX "debugfs: Board not initialized.\n");
res = -EFAULT;
goto out_unlock;
}
if (count > 0 && buf[0] == '1') {
bcm43xx_controller_restart(bcm, "manually restarted");
res = count;
} else
res = -EINVAL;

out_unlock:
spin_unlock_irqrestore(&(bcm)->irq_lock, flags);
mutex_unlock(&(bcm)->mutex);
out_up:
up(&big_buffer_sem);
return res;
}

#undef fappend


Expand Down Expand Up @@ -349,6 +385,11 @@ static struct file_operations txstat_fops = {
.open = open_file_generic,
};

static struct file_operations restart_fops = {
.write = restart_write_file,
.open = open_file_generic,
};


void bcm43xx_debugfs_add_device(struct bcm43xx_private *bcm)
{
Expand Down Expand Up @@ -400,6 +441,10 @@ void bcm43xx_debugfs_add_device(struct bcm43xx_private *bcm)
bcm, &txstat_fops);
if (!e->dentry_txstat)
printk(KERN_ERR PFX "debugfs: creating \"tx_status\" for \"%s\" failed!\n", devdir);
e->dentry_restart = debugfs_create_file("restart", 0222, e->subdir,
bcm, &restart_fops);
if (!e->dentry_restart)
printk(KERN_ERR PFX "debugfs: creating \"restart\" for \"%s\" failed!\n", devdir);
}

void bcm43xx_debugfs_remove_device(struct bcm43xx_private *bcm)
Expand All @@ -415,6 +460,7 @@ void bcm43xx_debugfs_remove_device(struct bcm43xx_private *bcm)
debugfs_remove(e->dentry_devinfo);
debugfs_remove(e->dentry_tsf);
debugfs_remove(e->dentry_txstat);
debugfs_remove(e->dentry_restart);
debugfs_remove(e->subdir);
kfree(e->xmitstatus_buffer);
kfree(e->xmitstatus_print_buffer);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ struct bcm43xx_dfsentry {
struct dentry *dentry_spromdump;
struct dentry *dentry_tsf;
struct dentry *dentry_txstat;
struct dentry *dentry_restart;

struct bcm43xx_private *bcm;

Expand Down
Loading

0 comments on commit 73eedac

Please sign in to comment.