static inline void ipw_rx_notification(struct ipw_priv *priv,				       struct ipw_rx_notification *notif){	notif->size = le16_to_cpu(notif->size);	IPW_DEBUG_NOTIF("type = %i (%d bytes)\n", notif->subtype, notif->size);	switch (notif->subtype) {	case HOST_NOTIFICATION_STATUS_ASSOCIATED:{			struct notif_association *assoc = &notif->u.assoc;			switch (assoc->state) {			case CMAS_ASSOCIATED:{					IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |						  IPW_DL_ASSOC,						  "associated: '%s' " MAC_FMT						  " \n",						  escape_essid(priv->essid,							       priv->essid_len),						  MAC_ARG(priv->bssid));					switch (priv->ieee->iw_mode) {					case IW_MODE_INFRA:						memcpy(priv->ieee->bssid,						       priv->bssid, ETH_ALEN);						break;					case IW_MODE_ADHOC:						memcpy(priv->ieee->bssid,						       priv->bssid, ETH_ALEN);						/* clear out the station table */						priv->num_stations = 0;						IPW_DEBUG_ASSOC						    ("queueing adhoc check\n");						queue_delayed_work(priv->								   workqueue,								   &priv->								   adhoc_check,								   priv->								   assoc_request.								   beacon_interval);						break;					}					priv->status &= ~STATUS_ASSOCIATING;					priv->status |= STATUS_ASSOCIATED;#ifdef CONFIG_IPW_QOS					if (priv->status & STATUS_AUTH) {						if ((sizeof						     (struct						      ieee80211_assoc_response_frame)						     <= notif->size)						    && (notif->size <= 2314)) {							struct							ieee80211_rx_stats							    stats = {								.len =								    notif->								    size - 1,							};							IPW_DEBUG_QOS							    ("QoS Associate "							     "size %d\n",							     notif->size);							ieee80211_rx_mgt(priv->									 ieee,									 (struct									  ieee80211_hdr									  *)									 &notif->u.raw, &stats);						}					}#endif					schedule_work(&priv->link_up);					break;				}			case CMAS_AUTHENTICATED:{					if (priv->					    status & (STATUS_ASSOCIATED |						      STATUS_AUTH)) {#ifdef CONFIG_IPW_DEBUG						struct notif_authenticate *auth						    = &notif->u.auth;						IPW_DEBUG(IPW_DL_NOTIF |							  IPW_DL_STATE |							  IPW_DL_ASSOC,							  "deauthenticated: '%s' "							  MAC_FMT							  ": (0x%04X) - %s \n",							  escape_essid(priv->								       essid,								       priv->								       essid_len),							  MAC_ARG(priv->bssid),							  ntohs(auth->status),							  ipw_get_status_code							  (ntohs							   (auth->status)));#endif						priv->status &=						    ~(STATUS_ASSOCIATING |						      STATUS_AUTH |						      STATUS_ASSOCIATED);						schedule_work(&priv->link_down);						break;					}					IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |						  IPW_DL_ASSOC,						  "authenticated: '%s' " MAC_FMT						  "\n",						  escape_essid(priv->essid,							       priv->essid_len),						  MAC_ARG(priv->bssid));					break;				}			case CMAS_INIT:{					if (priv->status & STATUS_AUTH) {						struct						    ieee80211_assoc_response						*resp;						resp =						    (struct						     ieee80211_assoc_response						     *)&notif->u.raw;						IPW_DEBUG(IPW_DL_NOTIF |							  IPW_DL_STATE |							  IPW_DL_ASSOC,							  "association failed (0x%04X): %s\n",							  ntohs(resp->status),							  ipw_get_status_code							  (ntohs							   (resp->status)));					}					IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |						  IPW_DL_ASSOC,						  "disassociated: '%s' " MAC_FMT						  " \n",						  escape_essid(priv->essid,							       priv->essid_len),						  MAC_ARG(priv->bssid));					priv->status &=					    ~(STATUS_DISASSOCIATING |					      STATUS_ASSOCIATING |					      STATUS_ASSOCIATED | STATUS_AUTH);					if (priv->assoc_network					    && (priv->assoc_network->						capability &						WLAN_CAPABILITY_IBSS))						ipw_remove_current_network						    (priv);					schedule_work(&priv->link_down);					break;				}			case CMAS_RX_ASSOC_RESP:				break;			default:				IPW_ERROR("assoc: unknown (%d)\n",					  assoc->state);				break;			}			break;		}	case HOST_NOTIFICATION_STATUS_AUTHENTICATE:{			struct notif_authenticate *auth = &notif->u.auth;			switch (auth->state) {			case CMAS_AUTHENTICATED:				IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE,					  "authenticated: '%s' " MAC_FMT " \n",					  escape_essid(priv->essid,						       priv->essid_len),					  MAC_ARG(priv->bssid));				priv->status |= STATUS_AUTH;				break;			case CMAS_INIT:				if (priv->status & STATUS_AUTH) {					IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |						  IPW_DL_ASSOC,						  "authentication failed (0x%04X): %s\n",						  ntohs(auth->status),						  ipw_get_status_code(ntohs								      (auth->								       status)));				}				IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |					  IPW_DL_ASSOC,					  "deauthenticated: '%s' " MAC_FMT "\n",					  escape_essid(priv->essid,						       priv->essid_len),					  MAC_ARG(priv->bssid));				priv->status &= ~(STATUS_ASSOCIATING |						  STATUS_AUTH |						  STATUS_ASSOCIATED);				schedule_work(&priv->link_down);				break;			case CMAS_TX_AUTH_SEQ_1:				IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |					  IPW_DL_ASSOC, "AUTH_SEQ_1\n");				break;			case CMAS_RX_AUTH_SEQ_2:				IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |					  IPW_DL_ASSOC, "AUTH_SEQ_2\n");				break;			case CMAS_AUTH_SEQ_1_PASS:				IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |					  IPW_DL_ASSOC, "AUTH_SEQ_1_PASS\n");				break;			case CMAS_AUTH_SEQ_1_FAIL:				IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |					  IPW_DL_ASSOC, "AUTH_SEQ_1_FAIL\n");				break;			case CMAS_TX_AUTH_SEQ_3:				IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |					  IPW_DL_ASSOC, "AUTH_SEQ_3\n");				break;			case CMAS_RX_AUTH_SEQ_4:				IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |					  IPW_DL_ASSOC, "RX_AUTH_SEQ_4\n");				break;			case CMAS_AUTH_SEQ_2_PASS:				IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |					  IPW_DL_ASSOC, "AUTH_SEQ_2_PASS\n");				break;			case CMAS_AUTH_SEQ_2_FAIL:				IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |					  IPW_DL_ASSOC, "AUT_SEQ_2_FAIL\n");				break;			case CMAS_TX_ASSOC:				IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |					  IPW_DL_ASSOC, "TX_ASSOC\n");				break;			case CMAS_RX_ASSOC_RESP:				IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |					  IPW_DL_ASSOC, "RX_ASSOC_RESP\n");				break;			case CMAS_ASSOCIATED:				IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |					  IPW_DL_ASSOC, "ASSOCIATED\n");				break;			default:				IPW_DEBUG_NOTIF("auth: failure - %d\n",						auth->state);				break;			}			break;		}	case HOST_NOTIFICATION_STATUS_SCAN_CHANNEL_RESULT:{			struct notif_channel_result *x =			    &notif->u.channel_result;			if (notif->size == sizeof(*x)) {				IPW_DEBUG_SCAN("Scan result for channel %d\n",					       x->channel_num);			} else {				IPW_DEBUG_SCAN("Scan result of wrong size %d "					       "(should be %zd)\n",					       notif->size, sizeof(*x));			}			break;		}	case HOST_NOTIFICATION_STATUS_SCAN_COMPLETED:{			struct notif_scan_complete *x = &notif->u.scan_complete;			if (notif->size == sizeof(*x)) {				IPW_DEBUG_SCAN				    ("Scan completed: type %d, %d channels, "				     "%d status\n", x->scan_type,				     x->num_channels, x->status);			} else {				IPW_ERROR("Scan completed of wrong size %d "					  "(should be %zd)\n",					  notif->size, sizeof(*x));			}			priv->status &=			    ~(STATUS_SCANNING | STATUS_SCAN_ABORTING);			cancel_delayed_work(&priv->scan_check);			if (priv->status & STATUS_EXIT_PENDING)				break;			priv->ieee->scans++;#ifdef CONFIG_IPW2200_MONITOR			if (priv->ieee->iw_mode == IW_MODE_MONITOR) {				queue_work(priv->workqueue,					   &priv->request_scan);				break;			}#endif				/* CONFIG_IPW2200_MONITOR */			if (!(priv->status & (STATUS_ASSOCIATED |					      STATUS_ASSOCIATING |					      STATUS_ROAMING |					      STATUS_DISASSOCIATING)))				queue_work(priv->workqueue, &priv->associate);			else if (priv->status & STATUS_ROAMING) {				/* If a scan completed and we are in roam mode, then				 * the scan that completed was the one requested as a				 * result of entering roam... so, schedule the				 * roam work */				queue_work(priv->workqueue, &priv->roam);			} else if (priv->status & STATUS_SCAN_PENDING)				queue_work(priv->workqueue,					   &priv->request_scan);			else if (priv->config & CFG_BACKGROUND_SCAN				 && priv->status & STATUS_ASSOCIATED)				queue_delayed_work(priv->workqueue,						   &priv->request_scan, HZ);			break;		}	case HOST_NOTIFICATION_STATUS_FRAG_LENGTH:{			struct notif_frag_length *x = &notif->u.frag_len;			if (notif->size == sizeof(*x))				IPW_ERROR("Frag length: %d\n",					  le16_to_cpu(x->frag_length));			else				IPW_ERROR("Frag length of wrong size %d "					  "(should be %zd)\n",					  notif->size, sizeof(*x));			break;		}	case HOST_NOTIFICATION_STATUS_LINK_DETERIORATION:{			struct notif_link_deterioration *x =			    &notif->u.link_deterioration;			if (notif->size == sizeof(*x)) {				IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE,					  "link deterioration: '%s' " MAC_FMT					  " \n", escape_essid(priv->essid,							      priv->essid_len),					  MAC_ARG(priv->bssid));				memcpy(&priv->last_link_deterioration, x,				       sizeof(*x));			} else {				IPW_ERROR("Link Deterioration of wrong size %d "					  "(should be %zd)\n",					  notif->size, sizeof(*x));			}			break;		}	case HOST_NOTIFICATION_DINO_CONFIG_RESPONSE:{			IPW_ERROR("Dino config\n");			if (priv->hcmd			    && priv->hcmd->cmd != HOST_CMD_DINO_CONFIG)				IPW_ERROR("Unexpected DINO_CONFIG_RESPONSE\n");			break;		}	case HOST_NOTIFICATION_STATUS_BEACON_STATE:{			struct notif_beacon_state *x = &notif->u.beacon_state;			if (notif->size != sizeof(*x)) {				IPW_ERROR				    ("Beacon state of wrong size %d (should "				     "be %zd)\n", notif->size, sizeof(*x));				break;			}			if (le32_to_cpu(x->state) ==			    HOST_NOTIFICATION_STATUS_BEACON_MISSING)				ipw_handle_missed_beacon(priv,							 le32_to_cpu(x->								     number));			break;		}	case HOST_NOTIFICATION_STATUS_TGI_TX_KEY:{			struct notif_tgi_tx_key *x = &notif->u.tgi_tx_key;			if (notif->size == sizeof(*x)) {				IPW_ERROR("TGi Tx Key: state 0x%02x sec type "					  "0x%02x station %d\n",					  x->key_state, x->security_type,					  x->station_index);				break;			}			IPW_ERROR			    ("TGi Tx Key of wrong size %d (should be %zd)\n",			     notif->size, sizeof(*x));			break;		}	case HOST_NOTIFICATION_CALIB_KEEP_RESULTS:{			struct notif_calibration *x = &notif->u.calibration;			if (notif->size == sizeof(*x)) {				memcpy(&priv->calib, x, sizeof(*x));				IPW_DEBUG_INFO("TODO: Calibration\n");				break;			}			IPW_ERROR			    ("Calibration of wrong size %d (should be %zd)\n",			     notif->size, sizeof(*x));			break;		}	case HOST_NOTIFICATION_NOISE_STATS:{			if (notif->size == sizeof(u32)) {				priv->last_noise =				    (u8) (le32_to_cpu(notif->u.noise.value) &					  0xff);				average_add(&priv->average_noise,					    priv->last_noise);				break;			}			IPW_ERROR			    ("Noise stat is wrong size %d (should be %zd)\n",			     notif->size, sizeof(u32));			break;		}	default:		IPW_ERROR("Unknown notification: "			  "subtype=%d,flags=0x%2x,size=%d\n",			  notif->subtype, notif->flags, notif->size);	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/afbf30a2b78cac38e6ddae10a73063943b4783ee/ipw2200.c/clean/drivers/net/wireless/ipw2200.c