⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 maintidi.c

📁 linux-2.6.15.6
💻 C
📖 第 1 页 / 共 5 页
字号:
            diva_mnt_internal_dprintf (0, DLI_ERR, "Unknon IDI Ind: %02x", Ind);        }      }    }  }	if ((ret = ScheduleNextTraceRequest(pLib))) {		return (-1);	}	return (ret);}/*	Internal state machine responsible for scheduling of requests	*/static int ScheduleNextTraceRequest (diva_strace_context_t* pLib) {	char name[64];	int ret = 0;	int i;	if (pLib->req_busy) {		return (0);	}  if (pLib->removal_state == 1) {		if (SuperTraceREMOVE (pLib->hAdapter)) {      pLib->removal_state = 3;    } else {      pLib->req_busy = 1;      pLib->removal_state = 2;    }    return (0);  }  if (pLib->removal_state) {    return (0);  }  if (!pLib->general_b_ch_event) {		if ((ret = SuperTraceTraceOnRequest(pLib->hAdapter, "State\\B Event", pLib->buffer))) {      return (-1);    }    pLib->general_b_ch_event = 1;		pLib->req_busy = 1;		return (0);  }  if (!pLib->general_fax_event) {		if ((ret = SuperTraceTraceOnRequest(pLib->hAdapter, "State\\FAX Event", pLib->buffer))) {      return (-1);    }    pLib->general_fax_event = 1;		pLib->req_busy = 1;		return (0);  }  if (!pLib->general_mdm_event) {		if ((ret = SuperTraceTraceOnRequest(pLib->hAdapter, "State\\Modem Event", pLib->buffer))) {      return (-1);    }    pLib->general_mdm_event = 1;		pLib->req_busy = 1;		return (0);  }	if (pLib->ChannelsTraceActive < pLib->Channels) {		pLib->ChannelsTraceActive++;		sprintf (name, "State\\B%d\\Line", pLib->ChannelsTraceActive);		if ((ret = SuperTraceTraceOnRequest(pLib->hAdapter, name, pLib->buffer))) {			pLib->ChannelsTraceActive--;			return (-1);		}		pLib->req_busy = 1;		return (0);	}	if (pLib->ModemTraceActive < pLib->Channels) {		pLib->ModemTraceActive++;		sprintf (name, "State\\B%d\\Modem\\Event", pLib->ModemTraceActive);		if ((ret = SuperTraceTraceOnRequest(pLib->hAdapter, name, pLib->buffer))) {			pLib->ModemTraceActive--;			return (-1);		}		pLib->req_busy = 1;		return (0);	}	if (pLib->FaxTraceActive < pLib->Channels) {		pLib->FaxTraceActive++;		sprintf (name, "State\\B%d\\FAX\\Event", pLib->FaxTraceActive);		if ((ret = SuperTraceTraceOnRequest(pLib->hAdapter, name, pLib->buffer))) {			pLib->FaxTraceActive--;			return (-1);		}		pLib->req_busy = 1;		return (0);	}	if (!pLib->trace_mask_init) {		word tmp = 0x0000;		if (SuperTraceWriteVar (pLib->hAdapter,														pLib->buffer,												 		"Trace\\Event Enable",												 		&tmp,												 		0x87, /* MI_BITFLD */												 		sizeof(tmp))) {			return (-1);		}		pLib->trace_mask_init = 1;		pLib->req_busy = 1;		return (0);	}	if (!pLib->audio_trace_init) {		dword tmp = 0x00000000;		if (SuperTraceWriteVar (pLib->hAdapter,														pLib->buffer,												 		"Trace\\AudioCh# Enable",												 		&tmp,												 		0x87, /* MI_BITFLD */												 		sizeof(tmp))) {			return (-1);		}		pLib->audio_trace_init = 2;		pLib->req_busy = 1;		return (0);	}	if (!pLib->bchannel_init) {		dword tmp = 0x00000000;		if (SuperTraceWriteVar (pLib->hAdapter,														pLib->buffer,												 		"Trace\\B-Ch# Enable",												 		&tmp,												 		0x87, /* MI_BITFLD */												 		sizeof(tmp))) {			return (-1);		}		pLib->bchannel_init = 1;		pLib->req_busy = 1;		return (0);	}	if (!pLib->trace_length_init) {		word tmp = 30;		if (SuperTraceWriteVar (pLib->hAdapter,														pLib->buffer,												 		"Trace\\Max Log Length",												 		&tmp,														0x82, /* MI_UINT */												 		sizeof(tmp))) {			return (-1);		}		pLib->trace_length_init = 1;		pLib->req_busy = 1;		return (0);	}	if (!pLib->trace_on) {		if (SuperTraceTraceOnRequest (pLib->hAdapter,																	"Trace\\Log Buffer",																	pLib->buffer)) {			return (-1);		}		pLib->trace_on = 1;		pLib->req_busy = 1;		return (0);	}	if (pLib->trace_event_mask != pLib->current_trace_event_mask) {		if (SuperTraceWriteVar (pLib->hAdapter,														pLib->buffer,												 		"Trace\\Event Enable",												 		&pLib->trace_event_mask,												 		0x87, /* MI_BITFLD */												 		sizeof(pLib->trace_event_mask))) {			return (-1);		}		pLib->current_trace_event_mask = pLib->trace_event_mask;		pLib->req_busy = 1;		return (0);	}	if ((pLib->audio_tap_pending >= 0) && (pLib->audio_tap_mask != pLib->current_audio_tap_mask)) {		if (SuperTraceWriteVar (pLib->hAdapter,														pLib->buffer,												 		"Trace\\AudioCh# Enable",												 		&pLib->audio_tap_mask,												 		0x87, /* MI_BITFLD */												 		sizeof(pLib->audio_tap_mask))) {			return (-1);		}		pLib->current_audio_tap_mask = pLib->audio_tap_mask;		pLib->audio_tap_pending = 1;		pLib->req_busy = 1;		return (0);	}	if ((pLib->eye_pattern_pending >= 0) && (pLib->audio_tap_mask != pLib->current_eye_pattern_mask)) {		if (SuperTraceWriteVar (pLib->hAdapter,														pLib->buffer,												 		"Trace\\EyeCh# Enable",												 		&pLib->audio_tap_mask,												 		0x87, /* MI_BITFLD */												 		sizeof(pLib->audio_tap_mask))) {			return (-1);		}		pLib->current_eye_pattern_mask = pLib->audio_tap_mask;		pLib->eye_pattern_pending = 1;		pLib->req_busy = 1;		return (0);	}	if (pLib->bchannel_trace_mask != pLib->current_bchannel_trace_mask) {		if (SuperTraceWriteVar (pLib->hAdapter,														pLib->buffer,												 		"Trace\\B-Ch# Enable",												 		&pLib->bchannel_trace_mask,												 		0x87, /* MI_BITFLD */												 		sizeof(pLib->bchannel_trace_mask))) {			return (-1);		}		pLib->current_bchannel_trace_mask = pLib->bchannel_trace_mask;		pLib->req_busy = 1;		return (0);	}	if (!pLib->trace_events_down) {		if (SuperTraceTraceOnRequest (pLib->hAdapter,																	"Events Down",																	pLib->buffer)) {			return (-1);		}		pLib->trace_events_down = 1;		pLib->req_busy = 1;		return (0);	}	if (!pLib->l1_trace) {		if (SuperTraceTraceOnRequest (pLib->hAdapter,																	"State\\Layer1",																	pLib->buffer)) {			return (-1);		}		pLib->l1_trace = 1;		pLib->req_busy = 1;		return (0);	}	if (!pLib->l2_trace) {		if (SuperTraceTraceOnRequest (pLib->hAdapter,																	"State\\Layer2 No1",																	pLib->buffer)) {			return (-1);		}		pLib->l2_trace = 1;		pLib->req_busy = 1;		return (0);	}	for (i = 0; i < 30; i++) {		if (pLib->pending_line_status & (1L << i)) {			sprintf (name, "State\\B%d", i+1);			if (SuperTraceReadRequest (pLib->hAdapter, name, pLib->buffer)) {				return (-1);			}			pLib->pending_line_status &= ~(1L << i);			pLib->req_busy = 1;			return (0);		}		if (pLib->pending_modem_status & (1L << i)) {			sprintf (name, "State\\B%d\\Modem", i+1);			if (SuperTraceReadRequest (pLib->hAdapter, name, pLib->buffer)) {				return (-1);			}			pLib->pending_modem_status &= ~(1L << i);			pLib->req_busy = 1;			return (0);		}		if (pLib->pending_fax_status & (1L << i)) {			sprintf (name, "State\\B%d\\FAX", i+1);			if (SuperTraceReadRequest (pLib->hAdapter, name, pLib->buffer)) {				return (-1);			}			pLib->pending_fax_status &= ~(1L << i);			pLib->req_busy = 1;			return (0);		}		if (pLib->clear_call_command & (1L << i)) {			sprintf (name, "State\\B%d\\Clear Call", i+1);			if (SuperTraceExecuteRequest (pLib->hAdapter, name, pLib->buffer)) {				return (-1);			}			pLib->clear_call_command &= ~(1L << i);			pLib->req_busy = 1;			return (0);		}	}	if (pLib->outgoing_ifc_stats) {		if (SuperTraceReadRequest (pLib->hAdapter,															 "Statistics\\Outgoing Calls",															 pLib->buffer)) {			return (-1);		}		pLib->outgoing_ifc_stats = 0;		pLib->req_busy = 1;		return (0);	}	if (pLib->incoming_ifc_stats) {		if (SuperTraceReadRequest (pLib->hAdapter,															 "Statistics\\Incoming Calls",															 pLib->buffer)) {			return (-1);		}		pLib->incoming_ifc_stats = 0;		pLib->req_busy = 1;		return (0);	}	if (pLib->modem_ifc_stats) {		if (SuperTraceReadRequest (pLib->hAdapter,															 "Statistics\\Modem",															 pLib->buffer)) {			return (-1);		}		pLib->modem_ifc_stats = 0;		pLib->req_busy = 1;		return (0);	}	if (pLib->fax_ifc_stats) {		if (SuperTraceReadRequest (pLib->hAdapter,															 "Statistics\\FAX",															 pLib->buffer)) {			return (-1);		}		pLib->fax_ifc_stats = 0;		pLib->req_busy = 1;		return (0);	}	if (pLib->b1_ifc_stats) {		if (SuperTraceReadRequest (pLib->hAdapter,															 "Statistics\\B-Layer1",															 pLib->buffer)) {			return (-1);		}		pLib->b1_ifc_stats = 0;		pLib->req_busy = 1;		return (0);	}	if (pLib->b2_ifc_stats) {		if (SuperTraceReadRequest (pLib->hAdapter,															 "Statistics\\B-Layer2",															 pLib->buffer)) {			return (-1);		}		pLib->b2_ifc_stats = 0;		pLib->req_busy = 1;		return (0);	}	if (pLib->d1_ifc_stats) {		if (SuperTraceReadRequest (pLib->hAdapter,															 "Statistics\\D-Layer1",															 pLib->buffer)) {			return (-1);		}		pLib->d1_ifc_stats = 0;		pLib->req_busy = 1;		return (0);	}	if (pLib->d2_ifc_stats) {		if (SuperTraceReadRequest (pLib->hAdapter,															 "Statistics\\D-Layer2",															 pLib->buffer)) {			return (-1);		}		pLib->d2_ifc_stats = 0;		pLib->req_busy = 1;		return (0);	}	if (!pLib->IncomingCallsCallsActive) {		pLib->IncomingCallsCallsActive = 1;		sprintf (name, "%s", "Statistics\\Incoming Calls\\Calls");		if ((ret = SuperTraceTraceOnRequest(pLib->hAdapter, name, pLib->buffer))) {			pLib->IncomingCallsCallsActive = 0;			return (-1);		}		pLib->req_busy = 1;		return (0);	}	if (!pLib->IncomingCallsConnectedActive) {		pLib->IncomingCallsConnectedActive = 1;		sprintf (name, "%s", "Statistics\\Incoming Calls\\Connected");		if ((ret = SuperTraceTraceOnRequest(pLib->hAdapter, name, pLib->buffer))) {			pLib->IncomingCallsConnectedActive = 0;			return (-1);		}		pLib->req_busy = 1;		return (0);	}	if (!pLib->OutgoingCallsCallsActive) {		pLib->OutgoingCallsCallsActive = 1;		sprintf (name, "%s", "Statistics\\Outgoing Calls\\Calls");		if ((ret = SuperTraceTraceOnRequest(pLib->hAdapter, name, pLib->buffer))) {			pLib->OutgoingCallsCallsActive = 0;			return (-1);		}		pLib->req_busy = 1;		return (0);	}	if (!pLib->OutgoingCallsConnectedActive) {		pLib->OutgoingCallsConnectedActive = 1;		sprintf (name, "%s", "Statistics\\Outgoing Calls\\Connected");		if ((ret = SuperTraceTraceOnRequest(pLib->hAdapter, name, pLib->buffer))) {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -