From: Johannes Berg <johannes@sipsolutions.net>
To: Philippe Agostini <philippe.agostini@gmail.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: SIOCSIFFLAGS: operation not supported error message when tryinging to bring up an interface in adhoc mode
Date: Fri, 06 Jul 2012 08:44:29 +0200 [thread overview]
Message-ID: <1341557069.4462.4.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <CADnjpYuWL1DQabomZiGPajv9108p7DwNHyTWwaKn48vVhRbMDg@mail.gmail.com> (sfid-20120705_164447_294068_46B96FA7)
On Thu, 2012-07-05 at 16:44 +0200, Philippe Agostini wrote:
> /* Supported channel */
> static struct ieee80211_channel channels = {
> .band = IEEE80211_BAND_2GHZ,
> .center_freq = 2437,
> .hw_value = 0,
> .flags = 0,
> .max_antenna_gain = 3,
> .max_power = 20,
> .max_reg_power = 20,
> .beacon_found = FALSE,
> .orig_flags = 0,
> .orig_mag = 0,
> .orig_mpwr = 0,
> };/* struct ieee80211_channel */
FWIW, you don't need to set zero values explicitly, like beacon_found.
"FALSE" also isn't valid in the kernel, it should be lower case?
> /* Configuration and hardware information for an 802.11 PHY */
> struct ieee80211_hw *hw = priv->hw;
So you're using mac80211,
> /* Number of available hardware queues */
> hw->queues = IEEE80211P_NUM_TXQ;
That constant seems a bit too generic, but we're just debugging your
driver now. I just don't think you should use "ieee80211p" as your
driver name/tag.
> //wiphy->signal_type = CFG80211p_SIGNAL_TYPE_NONE;
that is set by mac80211
> //wiphy->cipher_suites = NULL;
> //wiphy->n_cipher_suites = 0;
so is this unless you override it
> //wiphy->retry_short = 1;
> //wiphy->retry_long = 1;
> //wiphy->frag_threshold = -1;
> //wiphy->rts_threshold = -1;
> //wiphy_net_set(&hw->wiphy,NULL);
Heh, no, don't set any of these
> //SET_IEEE80211_DEV(hw,NULL);
That you should do
> //wiphy->wext = NULL;
don't touch :)
> /* Describes the frequency bands a wiphy is able to operate in */
> for (i = 0;i<IEEE80211_NUM_BANDS;i++) {
> wiphy->bands[i] = NULL;
> }
again, no need to 0-initialize anything, it just makes your code
needlessly large
Anyway, you've not shown the most important part, the driver ops that it
registers with mac80211.
johannes
next prev parent reply other threads:[~2012-07-06 6:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-05 14:25 SIOCSIFFLAGS: operation not supported error message when tryinging to bring up an interface in adhoc mode Philippe Agostini
2012-07-05 14:27 ` Johannes Berg
2012-07-05 14:44 ` Philippe Agostini
2012-07-06 6:44 ` Johannes Berg [this message]
2012-07-06 7:44 ` Philippe Agostini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1341557069.4462.4.camel@jlt3.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=philippe.agostini@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox