Discussion:
[Orinoco-users] patch and compile problem 0.13e
shai haim
2006-10-08 09:15:51 UTC
Permalink
Hi,
I'm trying to get the monitor to work on a 2.6.9 kernel (using fedora 3). my Orinoco version is 0.13e.
I have the source of the kernel and when i try to compile the driver I get :
make -C /lib/modules/2.6.9-1.667/build SUBDIRS=/root/Desktop/orinoco-0.13e modul esmake[1]: Entering directory `/lib/modules/2.6.9-1.667/build' CC [M] /root/Desktop/orinoco-0.13e/orinoco_cs.oIn file included from /root/Desktop/orinoco- 0.13e/orinoco.h:15, from /root/Desktop/orinoco-0.13e/orinoco_cs.c:42:/root/Desktop/orinoco-0.13e/hermes.h: In function `hermes_present':/root/Desktop/orinoco-0.13e/hermes.h:331: warning: passing arg 1 of `readw' make s pointer from integer without a cast /root/Desktop/orinoco-0.13e/hermes.h: In function `hermes_set_irqmask':/root/Desktop/orinoco-0.13e/hermes.h:337: warning: passing arg 2 of `writew' mak es pointer from integer without a cast/root/Desktop/orinoco- 0.13e/hermes.h: In function `hermes_read_words':/root/Desktop/orinoco-0.13e/hermes.h:378: warning: passing arg 1 of `readw' make s pointer from integer without a cast/root/Desktop/orinoco-0.13e/hermes.h: In function `hermes_write_words': /root/Desktop/orinoco-0.13e/hermes.h:398: warning: passing arg 2 of `writew' mak es pointer from integer without a cast/root/Desktop/orinoco-0.13e/hermes.h: In function `hermes_clear_words':/root/Desktop/orinoco- 0.13e/hermes.h:414: warning: passing arg 2 of `writew' mak es pointer from integer without a cast/root/Desktop/orinoco-0.13e/orinoco_cs.c: In function `orinoco_cs_hard_reset':/root/Desktop/orinoco-0.13e/orinoco_cs.c:134: warning: implicit declaration of f unction `CardServices' /root/Desktop/orinoco-0.13e/orinoco_cs.c: In function `orinoco_cs_attach':/root/Desktop/orinoco-0.13e/orinoco_cs.c:206: error: structure has no member nam ed `release'/root/Desktop/orinoco-0.13e/orinoco_cs.c:207: error: structure has no member nam ed `release' /root/Desktop/orinoco-0.13e/orinoco_cs.c:208: error: structure has no member nam ed `release'/root/Desktop/orinoco-0.13e/orinoco_cs.c: In function `init_orinoco_cs':/root/Desktop/orinoco-0.13e/orinoco_cs.c:688: warning: implicit declaration of f unction `register_pccard_driver'

/root/Desktop/orinoco-0.13e/orinoco_cs.c: In function `exit_orinoco_cs':/root/Desktop/orinoco-0.13e/orinoco_cs.c:696: warning: implicit declaration of f unction `unregister_pccard_driver'make[2]: *** [/root/Desktop/orinoco- 0.13e/orinoco_cs.o] Error 1make[1]: *** [_module_/root/Desktop/orinoco-0.13e] Error 2make[1]: Leaving directory `/lib/modules/2.6.9-1.667/build'make: *** [modules] Error 2

also when i try to apply the patch by dragon and snax to the files i get:
[***@comnet103 orinoco-0.13e]# patch -p1 < orinoco_patch.diffpatching file orinoco.cHunk #5 succeeded at 2381 (offset -27 lines).Hunk #6 FAILED at 3676.Hunk #7 FAILED at 3693.Hunk #8 FAILED at 3733. Hunk #9 succeeded at 4253 (offset -392 lines).3 out of 9 hunks FAILED -- saving rejects to file orinoco.c.rejand the output of the rej file is:***************
*** 3638,3652 ****
static int orinoco_wlansniff(struct net_device *dev, struct iwreq *wrq)
{
struct orinoco_private *priv = dev->priv;
-
- hermes_t *hw = &(priv->hw);
hermes_response_t resp;
- int result = 0;
- uint16_t word;

int *parms = (int *) wrq->u.name;
int enable = parms[0] > 0;
unsigned long flags;

orinoco_lock(priv, &flags);

--- 3676,3691 ----
static int orinoco_wlansniff(struct net_device *dev, struct iwreq *wrq)
{
struct orinoco_private *priv = dev->priv;
+ hermes_t *hw = &(priv->hw);
hermes_response_t resp;
+ int result = 0;
+ uint16_t word;

int *parms = (int *) wrq->u.name;
int enable = parms[0] > 0;
unsigned long flags;
+ int noMonitor = dev->type != ARPHRD_IEEE80211_PRISM &&
+ dev->type != ARPHRD_IEEE80211;

orinoco_lock(priv, &flags);

***************
*** 3654,3663 ****
{
case P80211ENUM_truth_false:
/* Confirm that we're in monitor mode */
- if ( dev->type == ARPHRD_ETHER ) {
result = -EFAULT;
}
/* Disable monitor mode */
word = HERMES_CMD_MONITOR | (HERMES_MONITOR_DISABLE << 8);
result = hermes_docmd_wait(hw, word, 0, &resp);

--- 3693,3703 ----
{
case P80211ENUM_truth_false:
/* Confirm that we're in monitor mode */
+ if ( noMonitor ) {
result = -EFAULT;
}
/* Disable monitor mode */
+ suppress_linkstatus = suppress_linkstatus_copy;
word = HERMES_CMD_MONITOR | (HERMES_MONITOR_DISABLE << 8);
result = hermes_docmd_wait(hw, word, 0, &resp);

***************
*** 3693,3773 ****

break;
case P80211ENUM_truth_true:
- /* Re-initialize the card before changing channel as advised at
- * http://lists.samba.org/pipermail/wireless/2002-June/004491.html
- * by Ian Goldberg. Implementation by Pat Swieskowski.
- */
- // __orinoco_down(dev);
- hermes_set_irqmask(hw, 0);
- hermes_init(hw);
- // _orinoco_up(dev);
- hermes_set_irqmask(hw, ORINOCO_INTEN);
- /*
- __orinoco_stop_irqs(priv);
- hermes_reset(hw);
- __orinoco_start_irqs(priv, HERMES_EV_RX | HERMES_EV_ALLOC |
- HERMES_EV_TX | HERMES_EV_TXEXC |
- HERMES_EV_WTERR | HERMES_EV_INFO |
- HERMES_EV_INFDROP);
- */
- /* Disable the port (if enabled), only check Port 0 */
- if ( hw->port_enabled[0] ) {
- /* Save macport 0 state */
- result = hermes_read_wordrec(hw, USER_BAP,
- HERMES_RID_CNF_PORTTYPE,
- &(priv->presniff_port_type));
- if ( result ) break;
-
- /* Save the wepflags state */
- result = hermes_read_wordrec(hw, USER_BAP,
- HERMES_RID_CNF_PRISM2_WEP_ON,
- &(priv->presniff_wepflags));
- if ( result ) break;
- result = hermes_disable_port(hw, 0);
- if ( result ) break;
- }
- else {
- priv->presniff_port_type = 0;
- }
-
- /* Set the channel we wish to sniff */
- if (parms[1] > 0 && parms[1] < 15) {
- word = parms[1];
- result = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNF_CHANNEL, word);
- } else {
- result = -EFAULT;
- }
-
- if ( result ) break;
-
- /* Set the port type to pIbss */
- word = HFA384x_PORTTYPE_IBSS;
- result = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNF_PORTTYPE, word);
- if ( result ) break;
-
- /*
- if ( (msg->keepwepflags.status == P80211ENUM_msgitem_status_data_ok) &&
- (msg->keepwepflags.data != P80211ENUM_truth_true)) {
- // Set the wepflags for no decryption //Orinoco doesn't like this
- word = HFA384x_WEPFLAGS_DISABLE_TXCRYPT |
- HFA384x_WEPFLAGS_DISABLE_RXCRYPT;
- result = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNF_PRISM2_WEP_ON, word); //won't work with the bits above
- }
- if ( result ) break;
-
- */
- /* Enable the port */
- result = hermes_enable_port(hw, 0);
- if ( result ) break;
-
- /* Enable monitor mode */
- word = HERMES_CMD_MONITOR | (HERMES_MONITOR_ENABLE << 8);
- result = hermes_docmd_wait(hw, word, 0, &resp);
- if ( result ) break;
-
/* Set the driver state */
/* Do we want the prism2 header? */
if (parms[0] == 1)
--- 3733,3808 ----

break;
case P80211ENUM_truth_true:
+ // Only do this if we're not in monitor mode already
+ if (noMonitor) {
+ /* Re-initialize the card before changing channel as advised at
+ * http://lists.samba.org/pipermail/wireless/2002-June/004491.html
+ * by Ian Goldberg. Implementation by Pat Swieskowski.
+ */
+ // __orinoco_down(dev);
+ hermes_set_irqmask(hw, 0);
+ hermes_init(hw);
+ // _orinoco_up(dev);
+ hermes_set_irqmask(hw, ORINOCO_INTEN);
+ suppress_linkstatus = 1;
+ /*
+ __orinoco_stop_irqs(priv);
+ hermes_reset(hw);
+ __orinoco_start_irqs(priv, HERMES_EV_RX | HERMES_EV_ALLOC |
+ HERMES_EV_TX | HERMES_EV_TXEXC |
+ HERMES_EV_WTERR | HERMES_EV_INFO |
+ HERMES_EV_INFDROP);
+ */
+ /* Disable the port (if enabled), only check Port 0 */
+ if ( hw->port_enabled[0] ) {
+ /* Save macport 0 state */
+ result = hermes_read_wordrec(hw, USER_BAP,
+ HERMES_RID_CNF_PORTTYPE,
+ &(priv->presniff_port_type));
+ if ( result ) break;
+
+ /* Save the wepflags state */
+ result = hermes_read_wordrec(hw, USER_BAP,
+ HERMES_RID_CNF_PRISM2_WEP_ON,
+ &(priv->presniff_wepflags));
+ if ( result ) break;
+ }
+ else {
+ priv->presniff_port_type = 0;
+ }
+ }
+
+ // Disable the port
+ result = hermes_disable_port(hw, 0);
+ if ( result ) break;
+
+ /* Set the channel we wish to sniff */
+ if (parms[1] > 0 && parms[1] < 15) {
+ word = parms[1];
+ result = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNF_CHANNEL, word);
+ } else {
+ result = -EFAULT;
+ }
+
+ if ( result ) break;
+
+ if (noMonitor) {
+ /* Set the port type to pIbss */
+ word = HFA384x_PORTTYPE_IBSS;
+ result = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNF_PORTTYPE, word);
+ if ( result ) break;
+
+ /* Enable monitor mode */
+ word = HERMES_CMD_MONITOR | (HERMES_MONITOR_ENABLE << 8);
+ result = hermes_docmd_wait(hw, word, 0, &resp);
+ if ( result ) break;
+ }
+
+ /* Enable the port */
+ result = hermes_enable_port(hw, 0);
+ if ( result ) break;
/* Set the driver state */
/* Do we want the prism2 header? */
if (parms[0] == 1)
Thanks for the help or any reference to help,Shai
_________________________________________________________________
Try the new Live Search today!
http://imagine-windowslive.com/minisites/searchlaunch/?locale=en-us&FORM=WLMTAG
Loading...