ar5523 driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

in the hope that this driver will drive my gigaset USB stick 108 (0x129b, 0x160c) i've updated it to compile with latest git. The driver now compiles fine, loads and unloads without problems. I've added my device as

+ AR5523_DEVICE_UG(0x129b, 0x160c), /* Gigaset / USB stick 108 (CyberTAN Technology) */

but the driver fails with: ar5523: probe of 1-1:1.0 failed with error -5

What does this mean? Also how do i know if my device is UG or UX?

I'm attaching the diff with kcompat* debian patches applied on top of svn for someone with more clue than me to review and hopefully test and apply. BTW, wouldn't be better to have the driver in staging with at least the debian patches already applied?

thanks,
riccardo
--- ar5523.c.orig	2009-11-07 17:14:56.000000000 +0100
+++ ar5523.c	2009-11-07 16:48:03.000000000 +0100
@@ -100,7 +100,6 @@ struct ar5523_rx_cmd {
 struct ar5523_tx_data {
 	struct ar5523		*ar;
 	struct sk_buff		*skb;
-	struct ieee80211_tx_control *control;
 };
 
 struct ar5523_rx_data {
@@ -499,7 +498,7 @@ static int ar5523_tx_null(struct ar5523 
 	return error;
 }
 
-static int ar5523_set_rates(struct ar5523 *ar, struct ieee80211_if_conf *ifconf)
+static int ar5523_set_rates(struct ar5523 *ar, struct ieee80211_bss_conf *ifconf)
 {
         struct ar5523_cmd_rates rates;
 
@@ -576,9 +575,10 @@ static void ar5523_data_rx_cb(struct urb
 	 */
 	rx_status.freq = be32_to_cpu(desc->freq);
 	rx_status.band = hw->conf.channel->band;
-	rx_status.ssi = be32_to_cpu(desc->rssi);
-	
-	ieee80211_rx_irqsafe(hw, data->skb, &rx_status);
+	rx_status.signal = be32_to_cpu(desc->rssi);
+
+	memcpy(IEEE80211_SKB_RXCB(data->skb), &rx_status, sizeof(rx_status));
+	ieee80211_rx_irqsafe(hw, data->skb);
 	
 	data->skb = __dev_alloc_skb(ar->rxbufsz, GFP_ATOMIC);
 	if (!data->skb) {
@@ -785,7 +785,7 @@ static void ar5523_data_tx_cb(struct urb
 	struct sk_buff *skb = urb->context;
 	struct ar5523_tx_data *data = (struct ar5523_tx_data *)skb->cb;
 	struct ar5523 *ar = data->ar;
-	struct ieee80211_tx_status status = { {0} };
+	struct ieee80211_tx_info *txi;
 
 	ar5523_dbg(ar, "data tx urb completed\n");
 
@@ -796,23 +796,23 @@ static void ar5523_data_tx_cb(struct urb
 		goto out;
 	}
 
-	memcpy(&status.control, data->control, sizeof(status.control));
+	txi = IEEE80211_SKB_CB(skb);
 	skb_pull(skb, sizeof(struct ar5523_tx_desc) + sizeof(__be32));
 
-	status.flags |= IEEE80211_TX_STATUS_ACK;
-	ieee80211_tx_status_irqsafe(ar->hw, skb, &status);
+	txi->flags |= IEEE80211_TX_STAT_ACK;
+	ieee80211_tx_status_irqsafe(ar->hw, skb);
  out:
 	atomic_dec(&ar->tx_data_queued);
 	usb_free_urb(urb);
 }
 
-static int ar5523_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
-		struct ieee80211_tx_control *control)
+static int ar5523_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
 {
 	struct ieee80211_hdr *wh = (struct ieee80211_hdr *)skb->data;
 	struct ar5523 *ar = hw->priv;
 	struct ar5523_tx_data *data;
 	struct ar5523_tx_desc *desc;
+	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 	struct urb *urb;
 	int paylen = skb->len;
 	int error = 0;
@@ -833,10 +833,6 @@ static int ar5523_tx(struct ieee80211_hw
 	data = (struct ar5523_tx_data *)skb->cb;
 	data->ar = ar;
 
-	data->control = kmemdup(control, sizeof(*control), GFP_ATOMIC);
-	if (!data->control)
-		goto out_free_urb;
-
 	desc = (struct ar5523_tx_desc *)skb_push(skb, sizeof(*desc));
 	hdr = (__be32 *)skb_push(skb, sizeof(__be32));
 
@@ -867,7 +863,7 @@ static int ar5523_tx(struct ieee80211_hw
 	error = usb_submit_urb(urb, GFP_ATOMIC);
 	if (error) {
 		ar5523_err(ar, "error %d when submitting tx urb\n", error);
-		goto out_free_control;
+		goto out_free_urb;
 	}
 
 
@@ -875,8 +871,6 @@ static int ar5523_tx(struct ieee80211_hw
 
 	return NETDEV_TX_OK;
 
- out_free_control:
-	kfree(control);
  out_free_urb:
 	usb_free_urb(urb);
  out_free_skb:
@@ -891,15 +885,15 @@ static int ar5523_add_interface(struct i
 
 	ar5523_dbg(ar, "add interface called\n");
 
-	/* NOTE: using IEEE80211_IF_TYPE_MNTR to indicate no mode selected */
-	if (ar->mode != IEEE80211_IF_TYPE_MNTR) {
+	/* NOTE: using NL80211_IFTYPE_MONITOR to indicate no mode selected */
+	if (ar->mode != NL80211_IFTYPE_MONITOR) {
 		ar5523_dbg(ar, "invalid add_interface\n");
 		return -EOPNOTSUPP;
 	}
 
 	switch (conf->type) {
-	case IEEE80211_IF_TYPE_STA:
-	case IEEE80211_IF_TYPE_MNTR:
+	case NL80211_IFTYPE_STATION:
+	case NL80211_IFTYPE_MONITOR:
 		ar->mode = conf->type;
 		break;
 	default:
@@ -916,12 +910,13 @@ static void ar5523_remove_interface(stru
 
 	ar5523_dbg(ar, "remove interface called\n");
 
-	ar->mode = IEEE80211_IF_TYPE_MNTR;
+	ar->mode = NL80211_IFTYPE_MONITOR;
 }
 
-static int ar5523_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
+static int ar5523_config(struct ieee80211_hw *hw, u32 changed)
 {
 	struct ar5523 *ar = hw->priv;
+	struct ieee80211_conf *conf = &hw->conf;
 	__be32 val;
 	int error;
 
@@ -965,9 +960,10 @@ static int ar5523_config(struct ieee8021
 	return 0;
 }
 
-static int ar5523_config_interface(struct ieee80211_hw *hw,
+static void ar5523_bss_info_changed(struct ieee80211_hw *hw,
 		struct ieee80211_vif *vif,
-		struct ieee80211_if_conf *ifconf)
+		struct ieee80211_bss_conf *ifconf,
+		u32 changed)
 {
 	struct ar5523 *ar = hw->priv;
 	struct ar5523_cmd_bssid bssid;
@@ -976,10 +972,13 @@ static int ar5523_config_interface(struc
 	__be32 val;
 	int error;
 
-	ar5523_dbg(ar, "config_interface called\n");
+	ar5523_dbg(ar, "bss_info_changed called\n");
 
 	ar5523_cmd_write(ar, AR5523_CMD_24, NULL, 0, 0);
 
+	if (!(changed & BSS_CHANGED_BSSID))
+		return;
+
 	memset(&bssid, 0, sizeof(bssid));
 	bssid.len = cpu_to_be32(AR5523_ADDR_LEN);
 	memcpy(&bssid.bssid, &ifconf->bssid, AR5523_ADDR_LEN);
@@ -999,7 +998,7 @@ static int ar5523_config_interface(struc
 	error = ar5523_set_rates(ar, ifconf);
 	if (error) {
 		ar5523_err(ar, "could not set negotiated rate set\n");
-		return error;
+		return;
 	}
 
 
@@ -1025,13 +1024,11 @@ static int ar5523_config_interface(struc
 
 	/* start statistics timer */
 	mod_timer(&ar->stat_timer, jiffies + HZ);
-
-	return 0;
 }
 
 static void ar5523_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 ar5523 *ar = hw->priv;
 
@@ -1049,7 +1046,7 @@ static const struct ieee80211_ops ar5523
 	.add_interface		= ar5523_add_interface,
 	.remove_interface	= ar5523_remove_interface,
 	.config			= ar5523_config,
-	.config_interface	= ar5523_config_interface,
+	.bss_info_changed	= ar5523_bss_info_changed,
 	.configure_filter	= ar5523_configure_filter,
 };
 
@@ -1509,7 +1506,7 @@ static int ar5523_probe(struct usb_inter
 
 	setup_timer(&ar->stat_timer, ar5523_stat, (unsigned long)ar);
 
-	ar->mode = IEEE80211_IF_TYPE_MNTR;
+	ar->mode = NL80211_IFTYPE_MONITOR;
 
 	hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS;
 	hw->extra_tx_headroom = sizeof(struct ar5523_tx_desc) + sizeof(__be32);
@@ -1579,6 +1576,7 @@ static struct usb_device_id ar5523_id_ta
 	AR5523_DEVICE_UX(0x2001, 0x3a04),	/* Dlink / DWLAG122 */
 	AR5523_DEVICE_UG(0x1690, 0x0712),	/* Gigaset / AR5523 */
 	AR5523_DEVICE_UG(0x1690, 0x0710),	/* Gigaset / SMCWUSBTG */
+	AR5523_DEVICE_UG(0x129b, 0x160c),	/* Gigaset / USB stick 108 (CyberTAN Technology) */
 	AR5523_DEVICE_UG(0x16ab, 0x7801),	/* Globalsun / AR5523_1 */
 	AR5523_DEVICE_UX(0x16ab, 0x7811),	/* Globalsun / AR5523_2 */
 	AR5523_DEVICE_UX(0x0846, 0x4300),	/* Netgear / WG111U */
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux