Lines Matching refs:np

33 static void ncsi_send_ebf(unsigned int np, unsigned int nc);
34 static void ncsi_send_ae(unsigned int np, unsigned int nc);
35 static void ncsi_send_gls(unsigned int np, unsigned int nc);
36 static int ncsi_send_command(unsigned int np, unsigned int nc, unsigned int cmd,
93 unsigned int np, nc; in ncsi_active() local
98 np = ncsi_priv->current_package; in ncsi_active()
104 return np < NCSI_PACKAGE_MAX && nc < NCSI_CHANNEL_MAX && in ncsi_active()
105 ncsi_priv->packages[np].channels[nc].has_link; in ncsi_active()
227 unsigned int np, nc; in ncsi_rsp_ec() local
229 np = NCSI_PACKAGE_INDEX(rsp->common.channel); in ncsi_rsp_ec()
232 if (ncsi_priv->packages[np].channels[nc].cap_aen != 0) in ncsi_rsp_ec()
233 ncsi_send_ae(np, nc); in ncsi_rsp_ec()
240 unsigned int np, nc; in ncsi_rsp_ecnt() local
242 np = NCSI_PACKAGE_INDEX(rsp->common.channel); in ncsi_rsp_ecnt()
245 ncsi_send_command(np, nc, NCSI_PKT_CMD_EC, NULL, 0, true); in ncsi_rsp_ecnt()
251 unsigned int np, nc; in ncsi_rsp_ebf() local
253 np = NCSI_PACKAGE_INDEX(rsp->common.channel); in ncsi_rsp_ebf()
256 ncsi_send_command(np, nc, NCSI_PKT_CMD_ECNT, NULL, 0, true); in ncsi_rsp_ebf()
262 unsigned int np, nc; in ncsi_rsp_sma() local
264 np = NCSI_PACKAGE_INDEX(rsp->common.channel); in ncsi_rsp_sma()
267 ncsi_send_ebf(np, nc); in ncsi_rsp_sma()
275 unsigned int np, nc; in ncsi_rsp_gc() local
277 np = NCSI_PACKAGE_INDEX(rsp->common.channel); in ncsi_rsp_gc()
280 if (np >= ncsi_priv->n_packages || in ncsi_rsp_gc()
281 nc >= ncsi_priv->packages[np].n_channels) { in ncsi_rsp_gc()
283 np, nc); in ncsi_rsp_gc()
287 c = &ncsi_priv->packages[np].channels[nc]; in ncsi_rsp_gc()
302 unsigned int np, nc, i; in ncsi_rsp_gvi() local
304 np = NCSI_PACKAGE_INDEX(rsp->common.channel); in ncsi_rsp_gvi()
307 if (np >= ncsi_priv->n_packages || in ncsi_rsp_gvi()
308 nc >= ncsi_priv->packages[np].n_channels) { in ncsi_rsp_gvi()
310 np, nc); in ncsi_rsp_gvi()
314 c = &ncsi_priv->packages[np].channels[nc]; in ncsi_rsp_gvi()
324 ncsi_send_command(np, nc, NCSI_PKT_CMD_GC, NULL, 0, true); in ncsi_rsp_gvi()
331 unsigned int np, nc; in ncsi_rsp_gls() local
333 np = NCSI_PACKAGE_INDEX(rsp->common.channel); in ncsi_rsp_gls()
336 if (np >= ncsi_priv->n_packages || in ncsi_rsp_gls()
337 nc >= ncsi_priv->packages[np].n_channels) { in ncsi_rsp_gls()
339 np, nc); in ncsi_rsp_gls()
343 ncsi_priv->packages[np].channels[nc].has_link = in ncsi_rsp_gls()
347 ncsi_send_command(np, nc, NCSI_PKT_CMD_GVI, NULL, 0, true); in ncsi_rsp_gls()
354 unsigned int np, nc; in ncsi_rsp_cis() local
356 np = NCSI_PACKAGE_INDEX(rsp->common.channel); in ncsi_rsp_cis()
359 if (np >= ncsi_priv->n_packages) { in ncsi_rsp_cis()
360 printf("NCSI: Mystery package 0x%02x from CIS\n", np); in ncsi_rsp_cis()
364 package = &ncsi_priv->packages[np]; in ncsi_rsp_cis()
389 ncsi_send_gls(np, nc); in ncsi_rsp_cis()
395 unsigned int np; in ncsi_rsp_dp() local
399 np = NCSI_PACKAGE_INDEX(rsp->common.channel); in ncsi_rsp_dp()
400 if (np >= ncsi_priv->n_packages) in ncsi_rsp_dp()
401 debug("NCSI: DP response from unknown package %d\n", np); in ncsi_rsp_dp()
407 unsigned int np; in ncsi_rsp_sp() local
409 np = NCSI_PACKAGE_INDEX(rsp->common.channel); in ncsi_rsp_sp()
411 if (np < ncsi_priv->n_packages) { in ncsi_rsp_sp()
413 debug("NCSI: package 0x%02x selected\n", np); in ncsi_rsp_sp()
417 debug("NCSI: adding new package %d\n", np); in ncsi_rsp_sp()
427 ncsi_priv->packages[np].id = np; in ncsi_rsp_sp()
428 ncsi_priv->packages[np].n_channels = 0; in ncsi_rsp_sp()
429 ncsi_priv->packages[np].channels = NULL; in ncsi_rsp_sp()
436 int np, nc; in ncsi_update_state() local
476 np = ncsi_priv->current_package; in ncsi_update_state()
480 if (ncsi_priv->packages[np].channels[nc].has_link) { in ncsi_update_state()
518 static int ncsi_send_command(unsigned int np, unsigned int nc, unsigned int cmd, in ncsi_send_command() argument
543 hdr->channel = NCSI_TO_CHANNEL(np, nc); in ncsi_send_command()
714 static void ncsi_send_sp(unsigned int np) in ncsi_send_sp() argument
718 ncsi_send_command(np, NCSI_RESERVED_CHANNEL, NCSI_PKT_CMD_SP, in ncsi_send_sp()
723 static void ncsi_send_dp(unsigned int np) in ncsi_send_dp() argument
725 ncsi_send_command(np, NCSI_RESERVED_CHANNEL, NCSI_PKT_CMD_DP, NULL, 0, in ncsi_send_dp()
729 static void ncsi_send_gls(unsigned int np, unsigned int nc) in ncsi_send_gls() argument
731 ncsi_send_command(np, nc, NCSI_PKT_CMD_GLS, NULL, 0, true); in ncsi_send_gls()
734 static void ncsi_send_cis(unsigned int np, unsigned int nc) in ncsi_send_cis() argument
736 ncsi_send_command(np, nc, NCSI_PKT_CMD_CIS, NULL, 0, true); in ncsi_send_cis()
739 static void ncsi_send_ae(unsigned int np, unsigned int nc) in ncsi_send_ae() argument
744 cmd.mode = htonl(ncsi_priv->packages[np].channels[nc].cap_aen); in ncsi_send_ae()
746 ncsi_send_command(np, nc, NCSI_PKT_CMD_AE, in ncsi_send_ae()
752 static void ncsi_send_ebf(unsigned int np, unsigned int nc) in ncsi_send_ebf() argument
757 cmd.mode = htonl(ncsi_priv->packages[np].channels[nc].cap_bc); in ncsi_send_ebf()
759 ncsi_send_command(np, nc, NCSI_PKT_CMD_EBF, in ncsi_send_ebf()
765 static void ncsi_send_sma(unsigned int np, unsigned int nc) in ncsi_send_sma() argument
782 ncsi_send_command(np, nc, NCSI_PKT_CMD_SMA, in ncsi_send_sma()
791 unsigned int np, nc; in ncsi_probe_packages() local
814 for (np = 0; np < ncsi_priv->n_packages; np++) { in ncsi_probe_packages()
815 package = &ncsi_priv->packages[np]; in ncsi_probe_packages()
822 if (np == ncsi_priv->n_packages) { in ncsi_probe_packages()
828 ncsi_priv->current_package = np; in ncsi_probe_packages()
831 ncsi_send_sma(np, nc); in ncsi_probe_packages()