/* Read directly the data (no seek) */ hermes_read_words(hw, HERMES_DATA1, (void *) &tallies, len / 2); /* FIXME: blech! */ 
err = hermes_bap_pread(hw, IRQ_BAP, &tallies, len, infofid, sizeof(info)); if (err) break; 
static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw){	struct orinoco_private *priv = netdev_priv(dev);	u16 infofid;	struct {		u16 len;		u16 type;	} __attribute__ ((packed)) info;	int len, type;	int err;	/* This is an answer to an INQUIRE command that we did earlier,	 * or an information "event" generated by the card	 * The controller return to us a pseudo frame containing	 * the information in question - Jean II */	infofid = hermes_read_regn(hw, INFOFID);	/* Read the info frame header - don't try too hard */	err = hermes_bap_pread(hw, IRQ_BAP, &info, sizeof(info),			       infofid, 0);	if (err) {		printk(KERN_ERR "%s: error %d reading info frame. "		       "Frame dropped.\n", dev->name, err);		return;	}		len = HERMES_RECLEN_TO_BYTES(le16_to_cpu(info.len));	type = le16_to_cpu(info.type);	switch (type) {	case HERMES_INQ_TALLIES: {		struct hermes_tallies_frame tallies;		struct iw_statistics *wstats = &priv->wstats;				if (len > sizeof(tallies)) {			printk(KERN_WARNING "%s: Tallies frame too long (%d bytes)\n",			       dev->name, len);			len = sizeof(tallies);		}				/* Read directly the data (no seek) */		hermes_read_words(hw, HERMES_DATA1, (void *) &tallies,				  len / 2); /* FIXME: blech! */				/* Increment our various counters */		/* wstats->discard.nwid - no wrong BSSID stuff */		wstats->discard.code +=			le16_to_cpu(tallies.RxWEPUndecryptable);		if (len == sizeof(tallies))  			wstats->discard.code +=				le16_to_cpu(tallies.RxDiscards_WEPICVError) +				le16_to_cpu(tallies.RxDiscards_WEPExcluded);		wstats->discard.misc +=			le16_to_cpu(tallies.TxDiscardsWrongSA);		wstats->discard.fragment +=			le16_to_cpu(tallies.RxMsgInBadMsgFragments);		wstats->discard.retries +=			le16_to_cpu(tallies.TxRetryLimitExceeded);		/* wstats->miss.beacon - no match */	}	break;	case HERMES_INQ_LINKSTATUS: {		struct hermes_linkstatus linkstatus;		u16 newstatus;		int connected;		if (len != sizeof(linkstatus)) {			printk(KERN_WARNING "%s: Unexpected size for linkstatus frame (%d bytes)\n",			       dev->name, len);			break;		}		hermes_read_words(hw, HERMES_DATA1, (void *) &linkstatus,				  len / 2);		newstatus = le16_to_cpu(linkstatus.linkstatus);		connected = (newstatus == HERMES_LINKSTATUS_CONNECTED)			|| (newstatus == HERMES_LINKSTATUS_AP_CHANGE)			|| (newstatus == HERMES_LINKSTATUS_AP_IN_RANGE);		if (connected)			netif_carrier_on(dev);		else if (!ignore_disconnect)			netif_carrier_off(dev);		if (newstatus != priv->last_linkstatus)			print_linkstatus(dev, newstatus);		priv->last_linkstatus = newstatus;	}	break;	default:		printk(KERN_DEBUG "%s: Unknown information frame received: "		       "type 0x%04x, length %d\n", dev->name, type, len);		/* We don't actually do anything about it */		break;	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/84d8a2fb56b1d3c915591a2c1aa321b783c7d00f/orinoco.c/clean/drivers/net/wireless/orinoco.c