View | Details | Raw Unified | Return to bug 7399 | Differences between
and this patch

Collapse All | Expand All

(-)a/zd_ieee80211.c (-3 lines)
Lines 133-141 int zd_find_channel(u8 *channel, const s Link Here
133
	int i, r;
133
	int i, r;
134
	u32 mhz;
134
	u32 mhz;
135
135
136
	if (!(freq->flags & IW_FREQ_FIXED))
137
		return 0;
138
139
	if (freq->m < 1000) {
136
	if (freq->m < 1000) {
140
		if (freq->m  > NUM_CHANNELS || freq->m == 0)
137
		if (freq->m  > NUM_CHANNELS || freq->m == 0)
141
			return -EINVAL;
138
			return -EINVAL;
(-)a/zd_mac.c (-13 / +4 lines)
Lines 508-528 int zd_mac_request_channel(struct zd_mac Link Here
508
		return 0;
508
		return 0;
509
}
509
}
510
510
511
int zd_mac_get_channel(struct zd_mac *mac, u8 *channel, u8 *flags)
511
u8 zd_mac_get_channel(struct zd_mac *mac)
512
{
512
{
513
	struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
513
	u8 channel = zd_chip_get_channel(&mac->chip);
514
514
515
	*channel = zd_chip_get_channel(&mac->chip);
515
	dev_dbg_f(zd_mac_dev(mac), "channel %u\n", channel);
516
	if (ieee->iw_mode != IW_MODE_INFRA) {
516
	return channel;
517
		spin_lock_irq(&mac->lock);
518
		*flags = *channel == mac->requested_channel ?
519
			MAC_FIXED_CHANNEL : 0;
520
		spin_unlock(&mac->lock);
521
	} else {
522
		*flags = 0;
523
	}
524
	dev_dbg_f(zd_mac_dev(mac), "channel %u flags %u\n", *channel, *flags);
525
	return 0;
526
}
517
}
527
518
528
/* If wrong rate is given, we are falling back to the slowest rate: 1MBit/s */
519
/* If wrong rate is given, we are falling back to the slowest rate: 1MBit/s */
(-)a/zd_mac.h (-5 / +1 lines)
Lines 120-129 struct rx_status { Link Here
120
120
121
#define ZD_RX_STRONG_SIGNAL_BOUNDARY	0x3a
121
#define ZD_RX_STRONG_SIGNAL_BOUNDARY	0x3a
122
122
123
enum mac_flags {
124
	MAC_FIXED_CHANNEL = 0x01,
125
};
126
127
struct housekeeping {
123
struct housekeeping {
128
	struct work_struct signal_strength_work;
124
	struct work_struct signal_strength_work;
129
	struct work_struct link_led_work;
125
	struct work_struct link_led_work;
Lines 205-211 int zd_mac_set_regdomain(struct zd_mac * Link Here
205
u8 zd_mac_get_regdomain(struct zd_mac *zd_mac);
201
u8 zd_mac_get_regdomain(struct zd_mac *zd_mac);
206
202
207
int zd_mac_request_channel(struct zd_mac *mac, u8 channel);
203
int zd_mac_request_channel(struct zd_mac *mac, u8 channel);
208
int zd_mac_get_channel(struct zd_mac *mac, u8 *channel, u8 *flags);
204
u8 zd_mac_get_channel(struct zd_mac *mac);
209
205
210
int zd_mac_set_mode(struct zd_mac *mac, u32 mode);
206
int zd_mac_set_mode(struct zd_mac *mac, u32 mode);
211
int zd_mac_get_mode(struct zd_mac *mac, u32 *mode);
207
int zd_mac_get_mode(struct zd_mac *mac, u32 *mode);
(-)a/zd_netdev.c (-12 / +1 lines)
Lines 107-127 static int iw_get_freq(struct net_device Link Here
107
	           struct iw_request_info *info,
107
	           struct iw_request_info *info,
108
		   union iwreq_data *req, char *extra)
108
		   union iwreq_data *req, char *extra)
109
{
109
{
110
	int r;
111
	struct zd_mac *mac = zd_netdev_mac(netdev);
110
	struct zd_mac *mac = zd_netdev_mac(netdev);
112
	struct iw_freq *freq = &req->freq;
111
	struct iw_freq *freq = &req->freq;
113
	u8 channel;
114
	u8 flags;
115
116
	r = zd_mac_get_channel(mac, &channel, &flags);
117
	if (r)
118
		return r;
119
112
120
	freq->flags = (flags & MAC_FIXED_CHANNEL) ?
113
	return zd_channel_to_freq(freq, zd_mac_get_channel(mac));
121
		      IW_FREQ_FIXED : IW_FREQ_AUTO;
122
	dev_dbg_f(zd_mac_dev(mac), "channel %s\n",
123
		  (flags & MAC_FIXED_CHANNEL) ? "fixed" : "auto");
124
	return zd_channel_to_freq(freq, channel);
125
}
114
}
126
115
127
static int iw_set_mode(struct net_device *netdev,
116
static int iw_set_mode(struct net_device *netdev,

Return to bug 7399