Re: Network Manager Patch
- From: Matthew Flaschen <matthew.flaschen@xxxxxxxxxx>
- Date: Thu, 22 Mar 2007 20:58:09 -0400
Patton Echols wrote:
1. Is this patch going to show up in Edgy?
2. Feisty?
Dunno.
3. How does one "easily" (or not so easily) apply such a thing?
If the answer to this last is RTFM, could someone point to the correct
"FM?" Understand, I look at the patch, I see source code, and wonder
WTF do I do with that?
Okay, that's understandable. It's a source code diff. A diff is
basically just that, the "difference" between two versions of the source
code. That means with the old version and the patch, you can make the
new version. The program you need for this conversion is patch. The
real problem is finding the right source code to start from. I tried
this with (on the command-line). It might not work (it didn't for me),
so don't get discouraged.:
mkdir NetworkManager
cd NetworkManager
apt-get source network-manager
That gets the version of the source code used for network-manager (in
Dapper in my case).
Then, I put the diff (at the bottom of the page you linked to) into a
file (which I've attached) into the NetworkManager directory.
Then, (starting in the NetworkManager directory)
cd network-manager-*
cp ../atheros.patch .
patch -p0 < atheros.patch
In my case, this didn't work, but you might have better luck. If you
get any questions, it probably won't work for you either. If it goes
through without questions, run:
sudo apt-get build-dep network-manager
It will want to download a lot of development libraries.
Then,
sudo dpkg-buildpackage -uc
If it works
cd..
dpkg -i *.deb
I don't mind a "double black diamond" learning
curve (*) but it'd be nice to know where the mountain is.
Try man patch and man diff .
Best,
Matt Flaschen
? src/.nm-device-802-11-wireless.c.swp
Index: src/nm-device-802-11-wireless.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/src/nm-device-802-11-wireless.c,v
retrieving revision 1.25
diff -u -r1.25 nm-device-802-11-wireless.c
--- src/nm-device-802-11-wireless.c 24 Jan 2006 00:46:52 -0000 1.25
+++ src/nm-device-802-11-wireless.c 24 Jan 2006 17:48:03 -0000
@@ -121,7 +121,8 @@
guint8 **out_res_buf,
guint32 *data_len);
-static int wireless_qual_to_percent (const struct iw_quality *qual,
+static int wireless_qual_to_percent (NMDevice *dev,
+ const struct iw_quality *qual,
const struct iw_quality *max_qual,
const struct iw_quality *avg_qual);
@@ -1017,7 +1018,8 @@
*
*/
static int
-wireless_qual_to_percent (const struct iw_quality *qual,
+wireless_qual_to_percent (NMDevice *dev,
+ const struct iw_quality *qual,
const struct iw_quality *max_qual,
const struct iw_quality *avg_qual)
{
@@ -1046,7 +1048,12 @@
* are free to use whatever they want to calculate "Link Quality".
*/
if ((max_qual->qual != 0) && !(max_qual->updated & IW_QUAL_QUAL_INVALID) && !(qual->updated & IW_QUAL_QUAL_INVALID))
- percent = (int)(100 * ((double)qual->qual / (double)max_qual->qual));
+ {
+ if (!strcmp (nm_device_get_driver (dev), "ath_pci"))
+ percent = (int) (100 * ((double) qual->qual / 62.0f));
+ else
+ percent = (int) (100 * ((double) qual->qual / (double) max_qual->qual));
+ }
/* If the driver doesn't specify a complete and valid quality, we have two options:
*
@@ -1172,7 +1179,7 @@
#endif
if (iw_get_stats (nm_dev_sock_get_fd (sk), iface, &stats, &range, has_range) == 0)
{
- percent = wireless_qual_to_percent (&stats.qual, (const iwqual *)(&self->priv->max_qual),
+ percent = wireless_qual_to_percent (NM_DEVICE (self), &stats.qual, (const iwqual *)(&self->priv->max_qual),
(const iwqual *)(&self->priv->avg_qual));
}
nm_dev_sock_close (sk);
@@ -3193,7 +3200,8 @@
nm_ap_set_freq (ap, iw_freq2float(&(iwe->u.freq)));
break;
case IWEVQUAL:
- nm_ap_set_strength (ap, wireless_qual_to_percent (&(iwe->u.qual),
+ nm_ap_set_strength (ap, wireless_qual_to_percent (&dev->parent,
+ &(iwe->u.qual),
(const iwqual *)(&dev->priv->max_qual),
(const iwqual *)(&dev->priv->avg_qual)));
break;
? src/.nm-device-802-11-wireless.c.swp
Index: src/nm-device-802-11-wireless.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/src/nm-device-802-11-wireless.c,v
retrieving revision 1.25
diff -u -r1.25 nm-device-802-11-wireless.c
--- src/nm-device-802-11-wireless.c 24 Jan 2006 00:46:52 -0000 1.25
+++ src/nm-device-802-11-wireless.c 24 Jan 2006 17:47:21 -0000
@@ -121,7 +121,8 @@
guint8 **out_res_buf,
guint32 *data_len);
-static int wireless_qual_to_percent (const struct iw_quality *qual,
+static int wireless_qual_to_percent (NMDevice *dev,
+ const struct iw_quality *qual,
const struct iw_quality *max_qual,
const struct iw_quality *avg_qual);
@@ -1017,7 +1018,8 @@
*
*/
static int
-wireless_qual_to_percent (const struct iw_quality *qual,
+wireless_qual_to_percent (NMDevice *dev,
+ const struct iw_quality *qual,
const struct iw_quality *max_qual,
const struct iw_quality *avg_qual)
{
@@ -1112,7 +1114,7 @@
}
/* If the quality percent was 0 or doesn't exist, then try to use signal levels instead */
- if ((percent < 1) && (level_percent >= 0))
+ if ((percent < 1 || !strcmp (nm_device_get_driver (dev), "ath_pci")) && (level_percent >= 0))
percent = level_percent;
#ifdef IW_QUAL_DEBUG
@@ -1172,7 +1174,7 @@
#endif
if (iw_get_stats (nm_dev_sock_get_fd (sk), iface, &stats, &range, has_range) == 0)
{
- percent = wireless_qual_to_percent (&stats.qual, (const iwqual *)(&self->priv->max_qual),
+ percent = wireless_qual_to_percent (NM_DEVICE (self), &stats.qual, (const iwqual *)(&self->priv->max_qual),
(const iwqual *)(&self->priv->avg_qual));
}
nm_dev_sock_close (sk);
@@ -3193,7 +3195,8 @@
nm_ap_set_freq (ap, iw_freq2float(&(iwe->u.freq)));
break;
case IWEVQUAL:
- nm_ap_set_strength (ap, wireless_qual_to_percent (&(iwe->u.qual),
+ nm_ap_set_strength (ap, wireless_qual_to_percent (&dev->parent,
+ &(iwe->u.qual),
(const iwqual *)(&dev->priv->max_qual),
(const iwqual *)(&dev->priv->avg_qual)));
break;
--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
- Follow-Ups:
- Re: Network Manager Patch
- From: Patton Echols
- Re: Network Manager Patch
- References:
- Network Manager Patch
- From: Patton Echols
- Network Manager Patch
- Prev by Date: Re: Anyone else having problems with feisty since this morning's update? - OK now
- Next by Date: Re: Dell's Linux Survey
- Previous by thread: Network Manager Patch
- Next by thread: Re: Network Manager Patch
- Index(es):
Relevant Pages
|
Loading