I apologize, this version is now cleanly passing check-patch.
-- Andres
On Sat, Sep 19, 2009 at 5:03 PM, Andrés Moré <more.andres@???> wrote:
> Resending 'forward port to wireless-next-2.6'
>
> I've made the suggested modification on disabling multicast for the
> moment and also added the step to include tx_status into the skb.
>
> 1) rx_status is now assumed to be bundled inside the RX skb.
>
> * Copying the data
> */
> memcpy(skb_put(rx_skb, payload_len), payload, payload_len);
> + memcpy(IEEE80211_SKB_RXCB(rx_skb), &rx_status, sizeof(rx_status));
> +
> /* Sending SKB upstream to the ieee80211 stack */
> - ieee80211_rx_irqsafe(hw, rx_skb, &rx_status);
> + ieee80211_rx_irqsafe(hw, rx_skb);
>
> 2) commented out multicast support as its handling has changed
> and can't be tested at the moment.
>
> <too long, see patch>
>
> 3) replaced queue_work by ieee80211_queue_work as it is done
> inside the ieee80211 stack now.
>
> - queue_work(hw->workqueue, &vt->config_filter_work);
> + ieee80211_queue_work(hw, &vt->config_filter_work);
>
> 4) implemented bss_info_changed, replacing the deprecated
> config_interface.
>
> <too long, already shown before in this thread>
>
> -- Andres
>
> On Tue, Sep 15, 2009 at 12:05 AM, Christoph Hellwig <hch@???> wrote:
>>
>> On Mon, Sep 14, 2009 at 07:31:21PM -0300, Andr?s Mor? wrote:
>> > I've started to work on forward porting the driver, please provide feedback.
>> > With this patch, everything is (almost) working as before.
>> >
>> > I'm not sure if it was expected, but I've to clear several changes on
>> > the callbacks, I hope to _not_ be missing something.
>> > I know, I should be reading linux-wireless :)
>>
>> Thanks a lot, this look pretty good.
>>
>> > Third, removed status as it is not longer required nor used.
>> >
>> > - struct ieee80211_rx_status rx_status = { 0 };
>> > size_t padded_payload_len;
>> > u16 payload_len;
>> > u16 real_framesize;
>> > @@ -314,12 +310,6 @@ static void vt6656_usb_rx_completed(struct urb *urb)
>> > printk(KERN_INFO "\n");
>> > }
>> > #endif
>> > - /*
>> > - * Filling up the rx status
>> > - */
>> > - rx_status.mactime = le64_to_cpu(rx_tail->TSFTime);
>> > - rx_status.band = IEEE80211_BAND_2GHZ;
>> > - rx_status.signal = rssi_to_dbm(rx_tail->RSSI);
>> >
>> > /*
>> > * Alloc a fresh skb for sending it up the mac80211 stack
>> > @@ -336,9 +326,10 @@ static void vt6656_usb_rx_completed(struct urb *urb)
>> > * Copying the data
>> > */
>> > memcpy(skb_put(rx_skb, payload_len), payload, payload_len);
>> > +
>> > /* Sending SKB upstream to the ieee80211 stack */
>> > - ieee80211_rx_irqsafe(hw, rx_skb, &rx_status);
>> > -
>> > + ieee80211_rx_irqsafe(hw, rx_skb);
>>
>> Not quite true unfortunately. Take a look at commit
>> f1d58c2521eb160178b2151d6326d8dc5d7c8560 in the wireless-testin tree
>> (git show f1d58c2521eb160178b2151d6326d8dc5d7c8560) for the glory
>> details.
>>
>> >
>> > Fourth, updated the callback as the parameters have changed.
>> >
>> > - int mc_count,
>> > - struct dev_addr_list *mc_list)
>> > + u64 multicast)
>> > {
>> > struct vt6656_dev *vt = hw->priv;
>> > printk(KERN_INFO "%s\n", __func__);
>> > @@ -878,11 +868,9 @@ static void vt6656_configure_filter(struct
>> > ieee80211_hw *hw,
>> > spin_lock(&vt->cfg_if_mutex);
>> > vt->total_flags = *total_flags;
>> > vt->changed_flags = changed_flags;
>> > - vt->mc_count = mc_count;
>> > - vt->mc_list = mc_list;
>> > spin_unlock(&vt->cfg_if_mutex);
>>
>> If we want to do it that simple we should remove the whole multi-cast
>> list handling for now. Which might not be a bad idea as we can't
>> easily test it.
>>
>> >
>> > Fifth, hw does not have anymore an explicit workqueue, seems to be
>> > handled automagically now.
>> >
>> > - queue_work(hw->workqueue, &vt->config_filter_work);
>> > + ieee80211_queue_work(hw, &vt->config_filter_work);
>>
>> As per commit 3ac64beecd27400d12cc7afb4108eef26c499f6a the
>> configure_filter method can sleep. So we can get rid of all that
>> workqueue business. That's a much large change, but simplifies this
>> area a lot/
>>
>> > Nth, implemented new callback which handles all BSS changes.
>>
>>
>> looks good.
>>
>> > Last, removed 'deprecated' call.
>>
>> Yeah, merged into bss_info_changed.
>>
>> _______________________________________________
>> Kernel-hackathon mailing list
>> Kernel-hackathon@???
>> https://mx.grulic.org.ar/mailman/listinfo/kernel-hackathon
>
>
>
> --
> Andres
>
--
Andres
commit 233d1ba5b6c388be54dfcddc495301e9ebf72358
Author: Andres More <more.andres@???>
Date: Sat Sep 19 17:13:10 2009 -0300
updated driver to compile and (almost) work on wireless-next-2.6.
1) rx_status is now assumed to be bundled inside the RX skb.
2) commented out multicast support as its handling has changed
and can't be tested at the moment.
3) replaced queue_work by ieee80211_queue_work as it is done
inside the ieee80211 stack now.
4) implemented bss_info_changed, replacing the deprecated
config_interface.
Signed-off-by: Andres More <more.andres@???>
diff --git a/vt6656.c b/vt6656.c
index 279f9e9..68f419c 100644
--- a/vt6656.c
+++ b/vt6656.c
@@ -393,8 +393,10 @@ static void vt6656_usb_rx_completed(struct urb *urb)
* Copying the data
*/
memcpy(skb_put(rx_skb, payload_len), payload, payload_len);
+ memcpy(IEEE80211_SKB_RXCB(rx_skb), &rx_status, sizeof(rx_status));
+
/* Sending SKB upstream to the ieee80211 stack */
- ieee80211_rx_irqsafe(hw, rx_skb, &rx_status);
+ ieee80211_rx_irqsafe(hw, rx_skb);
resubmit:
/*
@@ -914,10 +916,10 @@ static void vt6656_do_configure_filter(struct work_struct *worker)
config_filter_work);
unsigned int changed_flags = vt->changed_flags;
unsigned int total_flags = vt->total_flags;
- int mc_count = vt->mc_count;
+ /* int mc_count = vt->mc_count; */
/* struct dev_addr_list *mc_list = vt->mc_list; */
u8 mask_00[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0};
- u8 mask_ff[8] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+ /* u8 mask_ff[8] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; */
u8 tmp_mode = 0;
int error = 0;
int enable_multi = 0;
@@ -939,7 +941,7 @@ static void vt6656_do_configure_filter(struct work_struct *worker)
enable_multi = 1;
} else
disable_uni = 1;
- } else if ((changed_flags & FIF_ALLMULTI) || (mc_count > 0)) {
+ } /* else if ((changed_flags & FIF_ALLMULTI) || (mc_count > 0)) {
if (total_flags & FIF_ALLMULTI) {
error = vt6656_ctrl_write(vt->udev, MESSAGE_TYPE_WRITE,
MAC_REG_MAR0,
@@ -947,7 +949,7 @@ static void vt6656_do_configure_filter(struct work_struct *worker)
mask_ff, sizeof(mask_ff));
enable_multi = 1;
}
- } else {
+ } */ else {
error = vt6656_ctrl_write(vt->udev, MESSAGE_TYPE_WRITE,
MAC_REG_MAR0, MESSAGE_REQUEST_MACREG,
mask_00, sizeof(mask_00));
@@ -983,8 +985,7 @@ spin_unlock:
static void vt6656_configure_filter(struct ieee80211_hw *hw,
unsigned int changed_flags,
unsigned int *total_flags,
- int mc_count,
- struct dev_addr_list *mc_list)
+ u64 multicast)
{
struct vt6656_dev *vt = hw->priv;
printk(KERN_INFO "%s\n", __func__);
@@ -995,11 +996,11 @@ static void vt6656_configure_filter(struct ieee80211_hw *hw,
spin_lock(&vt->cfg_if_mutex);
vt->total_flags = *total_flags;
vt->changed_flags = changed_flags;
- vt->mc_count = mc_count;
- vt->mc_list = mc_list;
+ /* vt->mc_count = mc_count;
+ vt->mc_list = mc_list; */
spin_unlock(&vt->cfg_if_mutex);
- queue_work(hw->workqueue, &vt->config_filter_work);
+ ieee80211_queue_work(hw, &vt->config_filter_work);
}
static int mac_reg_bits_on(struct usb_device *dev, u8 by_reg_ofs, u8 by_bits)
@@ -1393,60 +1394,59 @@ static int set_channel(struct ieee80211_hw *hw, u16 nr_channel)
return 0;
}
-
-static int vt6656_config(struct ieee80211_hw *hw, u32 changed)
+static void vt6656_bss_info_changed(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif,
+ struct ieee80211_bss_conf *bss_conf,
+ u32 changed)
{
- int error = 0;
struct vt6656_dev *vt = hw->priv;
+ int error;
mutex_lock(&vt->cfg_mutex);
- vt->channel = hw->conf.channel->hw_value;
-
- if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
- error = set_channel(hw, vt->channel);
+ if (changed & BSS_CHANGED_BEACON_INT) {
+ error = mac_write_beacon_interval(vt->udev,
+ bss_conf->beacon_int);
if (error < 0)
goto out;
}
- if (changed & IEEE80211_CONF_CHANGE_BEACON_INTERVAL) {
- error = mac_write_beacon_interval(vt->udev,
- hw->conf.beacon_int);
- if (error < 0)
- goto out;
+ if (changed & BSS_CHANGED_BSSID) {
+ memcpy(vt->bssid, bss_conf->bssid, ETH_ALEN);
+
+ error = vt6656_ctrl_write(vt->udev,
+ MESSAGE_TYPE_WRITE,
+ MAC_REG_BSSID0,
+ MESSAGE_REQUEST_MACREG,
+ vt->bssid,
+ ETH_ALEN);
}
out:
mutex_unlock(&vt->cfg_mutex);
-
- return error;
}
-static int vt6656_config_interface(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
- struct ieee80211_if_conf *conf)
+static int vt6656_config(struct ieee80211_hw *hw, u32 changed)
{
- struct vt6656_dev *vt = hw->priv;
- struct usb_device *udev = vt->udev;
int error = 0;
+ struct vt6656_dev *vt = hw->priv;
- vt6656_info(vt, "%s\n", __func__);
-
- if (conf->changed & IEEE80211_IFCC_BSSID) {
- mutex_lock(&vt->cfg_mutex);
- memcpy(vt->bssid, conf->bssid, ETH_ALEN);
+ mutex_lock(&vt->cfg_mutex);
- error = vt6656_ctrl_write(udev, MESSAGE_TYPE_WRITE,
- MAC_REG_BSSID0,
- MESSAGE_REQUEST_MACREG, vt->bssid,
- ETH_ALEN);
+ vt->channel = hw->conf.channel->hw_value;
- mutex_unlock(&vt->cfg_mutex);
+ if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
+ error = set_channel(hw, vt->channel);
+ if (error < 0)
+ goto out;
}
+
+out:
+ mutex_unlock(&vt->cfg_mutex);
+
return error;
}
-
static void vt6656_usb_free_urbs(struct urb **urbs, u8 size)
{
int i = 0;
@@ -1663,7 +1663,7 @@ static struct ieee80211_ops vt6656_ops = {
.remove_interface = vt6656_remove_interface,
.configure_filter = vt6656_configure_filter,
.config = vt6656_config,
- .config_interface = vt6656_config_interface,
+ .bss_info_changed = vt6656_bss_info_changed,
};
static struct ieee80211_rate vt6656_rates[] = {