Lines Matching refs:g

264 		dev->dev_addr[0] = (fi->g.my_port_name_high & 0x0000FF00) >> 8;  in iph5526_probe_pci()
265 dev->dev_addr[1] = fi->g.my_port_name_high; in iph5526_probe_pci()
266 dev->dev_addr[2] = (fi->g.my_port_name_low & 0xFF000000) >> 24; in iph5526_probe_pci()
267 dev->dev_addr[3] = (fi->g.my_port_name_low & 0x00FF0000) >> 16; in iph5526_probe_pci()
268 dev->dev_addr[4] = (fi->g.my_port_name_low & 0x0000FF00) >> 8; in iph5526_probe_pci()
269 dev->dev_addr[5] = fi->g.my_port_name_low; in iph5526_probe_pci()
350 fi->g.mfs_buffer_count = 0;
369 fi->g.loop_up = FALSE;
370 fi->g.ptp_up = FALSE;
371 fi->g.link_up = FALSE;
372 fi->g.fabric_present = FALSE;
373 fi->g.n_port_try = FALSE;
374 fi->g.dont_init = FALSE;
375 fi->g.nport_timer_set = FALSE;
376 fi->g.lport_timer_set = FALSE;
377 fi->g.no_of_targets = 0;
378 fi->g.sem = 0;
379 fi->g.perform_adisc = FALSE;
380 fi->g.e_i = 0;
425 fi->g.els_buffer[0] = fi->q.ptr_mfsbq_base + MFSBQ_LENGTH*NO_OF_ENTRIES;
427 fi->g.els_buffer[i] = fi->g.els_buffer[i-1] + 64;
457 fi->g.arp_buffer = (char *)fi->q.ptr_sfsbq_base + SFSBQ_LENGTH*NO_OF_ENTRIES*4;
681 …if ((fi->g.link_up == FALSE) && ((imq_int_type == MFS_BUF_WARN) || (imq_int_type == SFS_BUF_WARN) …
701 if (fi->g.link_up == FALSE) {
719 if (fi->g.link_up == FALSE) {
740 if (fi->g.link_up == FALSE) {
875 if ((status == OCM_TIMEOUT_OR_BAD_ALPA) && (!fi->g.port_discovery) && (!fi->g.perform_adisc)){
942 fi->g.explore_fabric = TRUE;
943 fi->g.port_discovery = FALSE;
944 fi->g.alpa_list_index = MAX_NODES;
948 if (fi->g.fabric_present && (fi->g.name_server == FALSE))
967 if (fi->g.alpa_list_index >= MAX_NODES) {
968 if (fi->g.port_discovery == TRUE) {
969 fi->g.port_discovery = FALSE;
972 fi->g.alpa_list_index = MAX_NODES;
974 if (fi->g.port_discovery == TRUE)
1007 fi->g.mfs_buffer_count += no_of_buffers;
1008 if (fi->g.mfs_buffer_count >= NO_OF_ENTRIES) {
1009 int count = fi->g.mfs_buffer_count / NO_OF_ENTRIES;
1010 fi->g.mfs_buffer_count -= NO_OF_ENTRIES * count;
1077 fi->g.mfs_buffer_count += no_of_buffers;
1078 if (fi->g.mfs_buffer_count >= NO_OF_ENTRIES) {
1079 int count = fi->g.mfs_buffer_count / NO_OF_ENTRIES;
1080 fi->g.mfs_buffer_count -= NO_OF_ENTRIES * count;
1103 fi->g.mfs_buffer_count += no_of_buffers;
1104 if (fi->g.mfs_buffer_count >= NO_OF_ENTRIES) {
1105 int count = fi->g.mfs_buffer_count / NO_OF_ENTRIES;
1106 fi->g.mfs_buffer_count -= NO_OF_ENTRIES * count;
1190 build_ODB(fi, fi->g.seq_id, s_id, burst_len, 0, mtu, ox_id, rx_id, 0, 0, frame_class << 16);
1195 *(tach_header + 5) = htonl(fi->g.seq_id << 24);
1197 fi->g.odb.hdr_addr = *(fi->q.ptr_sest[x_id] + 5);
1236 fi->g.odb.edb_addr = htonl(virt_to_bus(ptr_edb));
1237 memcpy(fi->q.ptr_odb[fi->q.ocq_prod_indx], &(fi->g.odb), sizeof(ODB));
1244 if (fi->g.seq_id == MAX_SEQ_ID)
1245 fi->g.seq_id = 0;
1247 fi->g.seq_id++;
1490 if (s_id != fi->g.my_id) {
1514 fi->g.my_id = ntohl(*(buff_addr + 2)) & 0x00FFFFFF;
1515 fi->g.fabric_present = TRUE;
1516 fi->g.my_ddaa = fi->g.my_id & 0xFFFF00;
1522 fi->g.name_server = TRUE;
1613 if (fi->g.ptp_up == TRUE) {
1840 fi->g.link_up = FALSE;
1841 if (fi->g.ptp_up == TRUE)
1842 fi->g.n_port_try = FALSE;
1843 fi->g.ptp_up = FALSE;
1844 fi->g.port_discovery = FALSE;
1845 fi->g.explore_fabric = FALSE;
1846 fi->g.perform_adisc = FALSE;
1858 if ((fi->g.n_port_try == FALSE) && (fi->g.dont_init == FALSE)){
1863 if ((fi->g.fabric_present == TRUE) && (fi->g.loop_up == TRUE)) {
1864 u_int al_pa = fi->g.my_id & 0xFF;
1868 if (fi->g.loop_up == TRUE) {
1869 u_int al_pa = fi->g.my_id & 0xFF;
1874 fi->g.loop_up = FALSE;
1887 fi->g.link_up = TRUE;
1897 fi->g.loop_up = TRUE;
1898 fi->g.ptp_up = FALSE;
1899 fi->g.my_id = readl(fi->t_r.ptr_fm_config_reg) >> 24;
1900 DPRINTK1("My AL_PA = %x", fi->g.my_id);
1901 fi->g.port_discovery = TRUE;
1902 fi->g.explore_fabric = FALSE;
1906 fi->g.loop_up = FALSE;
1907 fi->g.my_id = 0x0;
1913 fi->g.explore_fabric = TRUE;
1914 fi->g.port_discovery = FALSE;
1915 if (fi->g.n_port_try == FALSE) {
1920 fi->g.n_port_try = TRUE;
1925 fi->g.ptp_up = TRUE;
1929 fi->g.my_ddaa = 0x0;
1930 fi->g.fabric_present = FALSE;
1932 fi->g.name_server = FALSE;
1933 fi->g.alpa_list_index = 0;
1934 fi->g.ox_id = NOT_SCSI_XID;
1935 fi->g.my_mtu = TACH_FRAME_SIZE;
1946 fi->g.perform_adisc = TRUE;
1948 fi->g.port_discovery = FALSE;
1955 fi->g.scsi_oxid = 0;
1956 fi->g.seq_id = 0x00;
1957 fi->g.perform_adisc = FALSE;
1974 if (fi->g.link_up == TRUE)
1975 tx_logi(fi, ELS_PLOGI, fi->g.my_id);
1986 if (fi->g.nport_timer_set == FALSE) {
1994 fi->g.nport_timer_set = TRUE;
2023 if ((fm_status & BAD_ALPA) && (fi->g.loop_up == TRUE)) {
2030 tx_logi(fi, ELS_PLOGI, fi->g.my_id);
2032 if (!fi->g.port_discovery && !fi->g.perform_adisc) {
2037 if ((fi->g.perform_adisc == TRUE) && (bad_alpa == 0x00)) {
2039 fi->g.fabric_present = FALSE;
2062 if (fi->g.alpa_list_index >= MAX_NODES){
2063 if (fi->g.port_discovery == TRUE) {
2064 fi->g.port_discovery = FALSE;
2067 fi->g.alpa_list_index = MAX_NODES;
2070 if (fi->g.port_discovery == TRUE)
2079 if (fi->g.loop_up == TRUE) {
2083 if ((fi->g.alpa_list_index == 0) && (fi->g.fabric_present == FALSE)){
2087 int login_state = sid_logged_in(fi, fi->g.my_ddaa | alpa_list[fi->g.alpa_list_index]);
2088g.alpa_list_index == 0) || ((fi->g.alpa_list_index < MAX_NODES) && ((login_state == NODE_LOGGED_IN…
2089 fi->g.alpa_list_index++;
2090 if (fi->g.alpa_list_index < MAX_NODES)
2091 tx_logi(fi, ELS_PLOGI, alpa_list[fi->g.alpa_list_index]);
2093 fi->g.alpa_list_index++;
2094 if (fi->g.alpa_list_index >= MAX_NODES){
2095 if (fi->g.port_discovery == TRUE) {
2096 fi->g.port_discovery = FALSE;
2099 fi->g.alpa_list_index = MAX_NODES;
2110 fi->g.nport_timer_set = FALSE;
2112 if ((fi->g.ptp_up == TRUE) || (fi->g.loop_up == TRUE))
2120 fi->g.n_port_try = TRUE;
2125 if ((fi->g.lport_timer_set == FALSE) && ((fm_status & 0xF0) == LOOP_FAIL)) {
2132 fi->g.lport_timer_set = TRUE;
2147 fi->g.lport_timer_set = FALSE;
2149 if ((fi->g.ptp_up == TRUE) || (fi->g.loop_up == TRUE))
2209 if (fi->g.loop_up == TRUE)
2235 fi->g.my_node_name_high = (fi->n_r.data[off] << 16) | fi->n_r.data[off+1];
2236 fi->g.my_node_name_low = (fi->n_r.data[off+2] << 16) | fi->n_r.data[off+3];
2237 fi->g.my_port_name_high = (fi->n_r.data[off+4] << 16) | fi->n_r.data[off+5];
2238 fi->g.my_port_name_low = (fi->n_r.data[off+6] << 16) | fi->n_r.data[off+7];
2239 DPRINTK("node_name = %x %x", fi->g.my_node_name_high, fi->g.my_node_name_low);
2240 DPRINTK("port_name = %x %x", fi->g.my_port_name_high, fi->g.my_port_name_low);
2264 u_int my_mtu = fi->g.my_mtu;
2269 if (d_id == fi->g.my_id)
2272 fi->g.type_of_frame = FC_ELS;
2273 memcpy(fi->g.els_buffer[fi->g.e_i], &fi->g.login, sizeof(LOGIN));
2274 …tx_exchange(fi, (char *)(fi->g.els_buffer[fi->g.e_i]),sizeof(LOGIN), r_ctl, type, d_id, my_mtu, in…
2275 fi->g.e_i++;
2276 if (fi->g.e_i == MAX_PENDING_FRAMES)
2277 fi->g.e_i = 0;
2287 u_int my_mtu = fi->g.my_mtu;
2290 fi->g.type_of_frame = FC_ELS;
2291 memcpy(fi->g.els_buffer[fi->g.e_i], &fi->g.login, sizeof(LOGIN));
2292 …tx_exchange(fi, (char *)(fi->g.els_buffer[fi->g.e_i]),sizeof(LOGIN), r_ctl, type, d_id, my_mtu, in…
2293 fi->g.e_i++;
2294 if (fi->g.e_i == MAX_PENDING_FRAMES)
2295 fi->g.e_i = 0;
2305 u_int my_mtu = fi->g.my_mtu;
2308 fi->g.prli.cmnd_code = htons((ELS_PRLI | PAGE_LEN) >> 16);
2310 fi->g.prli.cmnd_code = htons((ELS_ACC | PAGE_LEN) >> 16);
2315 fi->g.prli.payload_length = htons(PRLI_LEN);
2316 fi->g.prli.type_code = htons(FCP_TYPE_CODE);
2317 fi->g.prli.est_image_pair = htons(IMAGE_PAIR);
2318 fi->g.prli.responder_pa = 0;
2319 fi->g.prli.originator_pa = 0;
2320 fi->g.prli.service_params = htonl(INITIATOR_FUNC | READ_XFER_RDY_DISABLED);
2321 fi->g.type_of_frame = FC_ELS;
2322 memcpy(fi->g.els_buffer[fi->g.e_i], &fi->g.prli, sizeof(PRLI));
2323 …tx_exchange(fi, (char *)(fi->g.els_buffer[fi->g.e_i]), sizeof(PRLI), r_ctl, type, d_id, my_mtu, in…
2324 fi->g.e_i++;
2325 if (fi->g.e_i == MAX_PENDING_FRAMES)
2326 fi->g.e_i = 0;
2338 u_int my_mtu = fi->g.my_mtu;
2340 fi->g.logo.logo_cmnd = htonl(ELS_LOGO);
2341 fi->g.logo.reserved = 0;
2342 memcpy(fc_id, &(fi->g.my_id), 3);
2343 fi->g.logo.n_port_id_0 = fc_id[0];
2344 fi->g.logo.n_port_id_1 = fc_id[1];
2345 fi->g.logo.n_port_id_2 = fc_id[2];
2346 fi->g.logo.port_name_up = htonl(N_PORT_NAME_HIGH);
2347 fi->g.logo.port_name_low = htonl(N_PORT_NAME_LOW);
2348 fi->g.type_of_frame = FC_ELS;
2349 memcpy(fi->g.els_buffer[fi->g.e_i], &fi->g.logo, sizeof(LOGO));
2350 …tx_exchange(fi, (char *)(fi->g.els_buffer[fi->g.e_i]),size, r_ctl, type, d_id, my_mtu, int_require…
2351 fi->g.e_i++;
2352 if (fi->g.e_i == MAX_PENDING_FRAMES)
2353 fi->g.e_i = 0;
2363 u_int my_mtu = fi->g.my_mtu;
2364 fi->g.adisc.ls_cmnd_code = htonl(cmnd_code);
2365 fi->g.adisc.hard_address = htonl(0);
2366 fi->g.adisc.port_name_high = htonl(N_PORT_NAME_HIGH);
2367 fi->g.adisc.port_name_low = htonl(N_PORT_NAME_LOW);
2368 fi->g.adisc.node_name_high = htonl(NODE_NAME_HIGH);
2369 fi->g.adisc.node_name_low = htonl(NODE_NAME_LOW);
2370 fi->g.adisc.n_port_id = htonl(fi->g.my_id);
2376 fi->g.type_of_frame = FC_ELS;
2377 memcpy(fi->g.els_buffer[fi->g.e_i], &fi->g.adisc, size);
2378 …tx_exchange(fi, (char *)(fi->g.els_buffer[fi->g.e_i]),size, r_ctl, type, d_id, my_mtu, int_require…
2379 fi->g.e_i++;
2380 if (fi->g.e_i == MAX_PENDING_FRAMES)
2381 fi->g.e_i = 0;
2390 u_int my_mtu = fi->g.my_mtu;
2392 fi->g.ls_rjt.cmnd_code = htonl(ELS_LS_RJT);
2393 fi->g.ls_rjt.reason_code = htonl((reason_code << 16) | expln_code);
2394 fi->g.type_of_frame = FC_ELS;
2395 memcpy(fi->g.els_buffer[fi->g.e_i], &fi->g.ls_rjt, size);
2396 …tx_exchange(fi, (char *)(fi->g.els_buffer[fi->g.e_i]),size, r_ctl, type, d_id, my_mtu, int_require…
2397 fi->g.e_i++;
2398 if (fi->g.e_i == MAX_PENDING_FRAMES)
2399 fi->g.e_i = 0;
2409 u_int my_mtu = fi->g.my_mtu;
2411 fi->g.type_of_frame = FC_BLS;
2466 u_int my_mtu = fi->g.my_mtu;
2468 fi->g.acc.cmnd_code = htonl(ELS_ACC);
2469 fi->g.type_of_frame = FC_ELS;
2470 memcpy(fi->g.els_buffer[fi->g.e_i], &fi->g.acc, size);
2471 …tx_exchange(fi, (char *)(fi->g.els_buffer[fi->g.e_i]),size, r_ctl, type, d_id, my_mtu, int_require…
2472 fi->g.e_i++;
2473 if (fi->g.e_i == MAX_PENDING_FRAMES)
2474 fi->g.e_i = 0;
2485 u_int my_mtu = fi->g.my_mtu, d_id = DIRECTORY_SERVER;
2501 fi->g.type_of_frame = FC_ELS;
2504 memcpy(&(fi->g.rfc_4.ct_hdr), &ct_hdr, sizeof(CT_HDR));
2505 fi->g.rfc_4.s_id = htonl(fi->g.my_id);
2507 fi->g.rfc_4.bit_map[i] = 0;
2509 fi->g.rfc_4.bit_map[2] = 0x01;
2510 fi->g.rfc_4.bit_map[3] = 0x20;
2512 memcpy(fi->g.els_buffer[fi->g.e_i], &fi->g.rfc_4, size);
2513 …tx_exchange(fi, (char *)(fi->g.els_buffer[fi->g.e_i]),size, r_ctl, type, d_id, my_mtu, int_require…
2516 memcpy(&(fi->g.gp_id4.ct_hdr), &ct_hdr, sizeof(CT_HDR));
2517 fi->g.gp_id4.port_type = htonl(PORT_TYPE_NX_PORTS);
2519 memcpy(fi->g.els_buffer[fi->g.e_i], &fi->g.gp_id4, size);
2520 …tx_exchange(fi, (char *)(fi->g.els_buffer[fi->g.e_i]),size, r_ctl, type, d_id, my_mtu, int_require…
2523 fi->g.e_i++;
2524 if (fi->g.e_i == MAX_PENDING_FRAMES)
2525 fi->g.e_i = 0;
2535 u_int my_mtu = fi->g.my_mtu, d_id = FABRIC_CONTROLLER;
2537 fi->g.scr.cmnd_code = htonl(ELS_SCR);
2538 fi->g.scr.reg_function = htonl(FULL_REGISTRATION);
2539 fi->g.type_of_frame = FC_ELS;
2540 memcpy(fi->g.els_buffer[fi->g.e_i], &fi->g.scr, size);
2541 …tx_exchange(fi, (char *)(fi->g.els_buffer[fi->g.e_i]),size, r_ctl, type, d_id, my_mtu, int_require…
2542 fi->g.e_i++;
2543 if (fi->g.e_i == MAX_PENDING_FRAMES)
2544 fi->g.e_i = 0;
2553 fi->g.port_discovery = FALSE;
2595 if (d_id != fi->g.my_id) {
2626 if ((fi->g.loop_up == TRUE) && (fi->g.ptp_up == FALSE)) {
2629 fi->g.port_discovery = TRUE;
2630 fi->g.alpa_list_index = 1;
2633 fi->g.explore_fabric = FALSE;
2642 if ((fi->g.loop_up == TRUE) && (fi->g.explore_fabric != TRUE)) {
2643 fi->g.port_discovery = TRUE;
2644 fi->g.alpa_list_index = 1;
2647 fi->g.perform_adisc = FALSE;
2707 DPRINTK("d_id = %x, my_ddaa = %x", d_id, fi->g.my_ddaa);
2709 …if ((dest_ddaa != 0) && ((d_id == F_PORT) || (fi->g.fabric_present && (dest_ddaa != fi->g.my_ddaa)…
2711 fi->g.tach_header.resv = 0x00000000;
2712 fi->g.tach_header.sof_and_eof = SOFI3 | EOFN;
2713 fi->g.tach_header.dest_alpa = alpa;
2716 fi->g.tach_header.lcr_and_time_stamp = htons(0xC00);/* LCr=3 */
2718 fi->g.tach_header.lcr_and_time_stamp = 0;
2719 fi->g.tach_header.r_ctl_and_d_id = htonl(r_ctl | d_id);
2720 fi->g.tach_header.vc_id_and_s_id = htonl(my_id);
2721 fi->g.tach_header.type_and_f_cntl = htonl(type);
2722 fi->g.tach_header.seq_id = seq_id;
2723 fi->g.tach_header.df_cntl = df_ctl;
2724 fi->g.tach_header.seq_cnt = 0;
2725 fi->g.tach_header.ox_id = htons(ox_id);
2726 fi->g.tach_header.rx_id = htons(rx_id);
2727 fi->g.tach_header.ro = 0;
2732 if (fi->g.type_of_frame == FC_BROADCAST)
2733 fi->g.tach_header.seq_cnt = htons(0x1);
2735 fi->g.tach_header.seq_cnt = htons(0x2);
2736 fi->g.tach_header.nw_header.d_naa = htons(0x1000);
2737 fi->g.tach_header.nw_header.s_naa = htons(0x1000);
2738 memcpy(&(fi->g.tach_header.nw_header.dest_high), data, 2);
2739 memcpy(&(fi->g.tach_header.nw_header.dest_low), data + 2, 4);
2740 memcpy(&(fi->g.tach_header.nw_header.source_high), data + 6, 2);
2741 memcpy(&(fi->g.tach_header.nw_header.source_low), data + 8, 4);
2748 fi->g.edb.buf_addr = ntohl((u_int)virt_to_bus(data));
2749 fi->g.edb.ehf = ntohs(flags);
2752 fi->g.edb.buf_len = ntohs(len);
2757 fi->g.odb.seq_d_id = htonl(seq_id << 24 | d_id);
2758 fi->g.odb.tot_len = len;
2760 fi->g.odb.tot_len += NW_HEADER_LEN;
2761 if (fi->g.odb.tot_len % 4)
2762 fi->g.odb.tot_len += (4 - (fi->g.odb.tot_len % 4));
2763 fi->g.odb.tot_len = htonl(fi->g.odb.tot_len);
2766 fi->g.odb.cntl = htons(ODB_CLASS_3 | ODB_EE_CREDIT | ODB_NO_INT | ODB_NO_COMP | cntl);
2769 fi->g.odb.cntl = htons(ODB_CLASS_3 | ODB_EE_CREDIT | cntl);
2772 fi->g.odb.cntl = htons(ODB_CLASS_3 | ODB_EE_CREDIT | ODB_NO_INT | cntl);
2775 fi->g.odb.rx_id = htons(rx_id);
2776 fi->g.odb.cs_enable = 0;
2777 fi->g.odb.cs_seed = htons(1);
2779 fi->g.odb.hdr_addr = htonl(virt_to_bus(fi->q.ptr_tachyon_header[fi->q.tachyon_header_indx]));
2780 fi->g.odb.frame_len = htons(mtu);
2786 fi->g.odb.trans_id = htonl(frame_class);
2787 fi->g.odb.hdr_len = TACHYON_HEADER_LEN + NW_HEADER_LEN;
2791 fi->g.odb.trans_id = htonl((frame_class & 0xFFFF0000) | ox_id);
2792 fi->g.odb.hdr_len = TACHYON_HEADER_LEN;
2794 fi->g.odb.hdr_len = htons(fi->g.odb.hdr_len);
2796 fi->g.odb.edb_addr = htonl(virt_to_bus(fi->q.ptr_edb[fi->q.edb_buffer_indx]));
2802 fi->g.login.ls_cmnd_code= htonl(logi);
2803 fi->g.login.fc_ph_version = htons(PH_VERSION);
2804 if (fi->g.loop_up)
2805 fi->g.login.buff_to_buff_credit = htons(LOOP_BB_CREDIT);
2807 if (fi->g.ptp_up)
2808 fi->g.login.buff_to_buff_credit = htons(PT2PT_BB_CREDIT);
2810 fi->g.login.common_features = htons(PLOGI_C_F);
2813 fi->g.login.common_features = htons(FLOGI_C_F);
2814 fi->g.login.recv_data_field_size = htons(TACH_FRAME_SIZE);
2815 fi->g.login.n_port_total_conc_seq = htons(CONCURRENT_SEQUENCES);
2816 fi->g.login.rel_off_by_info_cat = htons(RO_INFO_CATEGORY);
2817 fi->g.login.ED_TOV = htonl(E_D_TOV);
2818 fi->g.login.n_port_name_high = htonl(N_PORT_NAME_HIGH);
2819 fi->g.login.n_port_name_low = htonl(N_PORT_NAME_LOW);
2820 fi->g.login.node_name_high = htonl(NODE_NAME_HIGH);
2821 fi->g.login.node_name_low = htonl(NODE_NAME_LOW);
2824 fi->g.login.c_of_s[0].service_options = htons(0);
2825 fi->g.login.c_of_s[0].initiator_ctl = htons(0);
2826 fi->g.login.c_of_s[0].recipient_ctl = htons(0);
2827 fi->g.login.c_of_s[0].recv_data_field_size = htons(0);
2828 fi->g.login.c_of_s[0].concurrent_sequences = htons(0);
2829 fi->g.login.c_of_s[0].n_port_end_to_end_credit = htons(0);
2830 fi->g.login.c_of_s[0].open_seq_per_exchange = htons(0);
2831 fi->g.login.c_of_s[0].resv = htons(0);
2834 fi->g.login.c_of_s[1].service_options = htons(0);
2835 fi->g.login.c_of_s[1].initiator_ctl = htons(0);
2836 fi->g.login.c_of_s[1].recipient_ctl = htons(0);
2837 fi->g.login.c_of_s[1].recv_data_field_size = htons(0);
2838 fi->g.login.c_of_s[1].concurrent_sequences = htons(0);
2839 fi->g.login.c_of_s[1].n_port_end_to_end_credit = htons(0);
2840 fi->g.login.c_of_s[1].open_seq_per_exchange = htons(0);
2841 fi->g.login.c_of_s[1].resv = htons(0);
2845 fi->g.login.c_of_s[2].service_options = htons(SERVICE_VALID | SEQUENCE_DELIVERY);
2847 fi->g.login.c_of_s[2].service_options = htons(SERVICE_VALID);
2848 fi->g.login.c_of_s[2].initiator_ctl = htons(0);
2849 fi->g.login.c_of_s[2].recipient_ctl = htons(0);
2850 fi->g.login.c_of_s[2].recv_data_field_size = htons(TACH_FRAME_SIZE);
2851 fi->g.login.c_of_s[2].concurrent_sequences = htons(CLASS3_CONCURRENT_SEQUENCE);
2852 fi->g.login.c_of_s[2].n_port_end_to_end_credit = htons(0);
2853 fi->g.login.c_of_s[2].open_seq_per_exchange = htons(CLASS3_OPEN_SEQUENCE);
2854 fi->g.login.c_of_s[2].resv = htons(0);
2857 fi->g.login.resv[i] = 0;
2858 fi->g.login.vendor_version_level[i] = 0;
3014 fi->g.type_of_frame = FC_IP;
3021 fi->g.type_of_frame = FC_BROADCAST;
3027 if ((d_id & 0xFFFF00) == fi->g.my_ddaa)
3028 …return_value |= tx_exchange(fi, skb->data, len, r_ctl, type, d_id, fi->g.my_mtu, int_required, ox_…
3054 u_int my_mtu = fi->g.my_mtu;
3058 fi->g.type_of_frame = FC_IP;
3065 memcpy(fi->g.arp_buffer, data - 2*FC_ALEN, len + 2*FC_ALEN);
3066 fi->g.arp_buffer[9 + 2*FC_ALEN] = 0x01;
3067 …return_value |= tx_exchange(fi, (char *)(fi->g.arp_buffer + 2*FC_ALEN), len, r_ctl, type, d_id, my…
3072 fi->g.type_of_frame = FC_BROADCAST;
3074 if ((d_id & 0xFFFF00) == fi->g.my_ddaa) {
3077 memcpy(fi->g.arp_buffer, data - 2*FC_ALEN, len + 2*FC_ALEN);
3078 fi->g.arp_buffer[9 + 2*FC_ALEN] = 0x01;
3079 …return_value |= tx_exchange(fi, (char *)(fi->g.arp_buffer + 2*FC_ALEN), len, r_ctl, type, d_id, my…
3097 memcpy(fi->g.arp_buffer, data - 2*FC_ALEN, len + 2*FC_ALEN);
3098 fi->g.arp_buffer[9 + 2*FC_ALEN] = 0x01;
3099 …return tx_exchange(fi, (char *)(fi->g.arp_buffer + 2*FC_ALEN), len, r_ctl, type, d_id, my_mtu, int…
3183 u_int my_id = fi->g.my_id;
3194 switch(fi->g.type_of_frame) {
3196 tx_ox_id = fi->g.scsi_oxid | SCSI_READ_BIT;
3199 tx_ox_id = fi->g.scsi_oxid;
3202 tx_ox_id = fi->g.ox_id;
3207 switch(fi->g.type_of_frame) {
3209 rx_id = fi->g.scsi_oxid | SCSI_READ_BIT;
3212 rx_id = fi->g.scsi_oxid;
3218 rx_id = fi->g.ox_id;
3229 …build_tachyon_header(fi, my_id, r_ctl, d_id, type, fi->g.seq_id, df_ctl, tx_ox_id, rx_id, data - 2…
3236 build_tachyon_header(fi, my_id, r_ctl, d_id, type, fi->g.seq_id, df_ctl, tx_ox_id, rx_id, NULL);
3245 memcpy(fi->q.ptr_tachyon_header[fi->q.tachyon_header_indx], &(fi->g.tach_header), h_size);
3248 …memcpy(fi->q.ptr_tachyon_header[fi->q.tachyon_header_indx], &(fi->g.tach_header), TACHYON_HEADER_L…
3250 …return_value = tx_sequence(fi, data, len, mtu, d_id, tx_ox_id, rx_id, fi->g.seq_id, NW_flag, int_r…
3252 switch(fi->g.type_of_frame) {
3260 fi->g.ox_id++;
3261 if (fi->g.ox_id == 0xFFFF)
3262 fi->g.ox_id = NOT_SCSI_XID;
3266 if (fi->g.seq_id == MAX_SEQ_ID)
3267 fi->g.seq_id = 0;
3269 fi->g.seq_id++;
3280 memcpy(fi->q.ptr_edb[fi->q.edb_buffer_indx], &(fi->g.edb), sizeof(EDB));
3282 memcpy(fi->q.ptr_odb[fi->q.ocq_prod_indx], &(fi->g.odb), sizeof(ODB));
3283 if (fi->g.link_up != TRUE) {
3599 if (fi->g.no_of_targets <= MAX_SCSI_TARGETS)
3600 temp->target_id = fi->g.no_of_targets++;
3679 …printk("My FC_ID = %x, My WWN = %x %x, ", fi->g.my_id, fi->g.my_node_name_high, fi->g.my_node_name…
3680 if (fi->g.ptp_up == TRUE)
3682 if (fi->g.loop_up == TRUE)
3791 fi->g.mem_base = ioremap(pci_maddr & PAGE_MASK, 1024);
3799 fi->g.tachyon_base = (u_long)fi->g.mem_base + TACHYON_OFFSET + ( pci_maddr & ~PAGE_MASK );
3800 DPRINTK("fi->g.tachyon_base = %x", (u_int)fi->g.tachyon_base);
3801 if (fi->g.mem_base == NULL) {
3843 …(jiffies, timeout) && ((fi->g.link_up == FALSE) || (fi->g.port_discovery == TRUE) || (fi->g.explor…
3934 fi->q.free_scsi_oxid[fi->g.scsi_oxid] = OXID_INUSE;
3939 hostdata->cmnd_handler[fi->g.scsi_oxid] = Cmnd;
3945 fi->g.type_of_frame = FC_SCSI_WRITE;
3949 fi->g.type_of_frame = FC_SCSI_READ;
3958 u_int bad_id = fi->g.my_ddaa | 0xFE;
3965 if (fi->g.ptp_up == TRUE)
3967 …tx_exchange(fi, (char *)(&(hostdata->cmnd)), sizeof(fcp_cmd), r_ctl, type, bad_id, fi->g.my_mtu, i…
4008 u_int bad_id = fi->g.my_ddaa | 0xFE;
4016 …tx_exchange(fi, (char *)(&(hostdata->cmnd)), sizeof(fcp_cmd), r_ctl, type, bad_id, fi->g.my_mtu, i…
4129 if (fi->g.loop_up == TRUE) {
4143 if (fi->g.ptp_up == TRUE) {
4154 fi->g.n_port_try = TRUE;
4207 switch(fi->g.type_of_frame) {
4209 fi->g.inb_sest_entry.flags_and_byte_offset = htonl(INB_SEST_VED);
4210 fi->g.inb_sest_entry.byte_count = 0;
4211 fi->g.inb_sest_entry.no_of_recvd_frames = 0;
4212 fi->g.inb_sest_entry.no_of_expected_frames = 0;
4213 fi->g.inb_sest_entry.last_fctl = 0;
4249 fi->g.inb_sest_entry.sdb_address = htonl(virt_to_bus(ptr_sdb));
4278 fi->g.inb_sest_entry.scratch_pad = fi->q.sdb_indx;
4279 fi->g.inb_sest_entry.expected_ro = 0;
4280 fi->g.inb_sest_entry.buffer_index = 0;
4281 fi->g.inb_sest_entry.buffer_offset = 0;
4282 memcpy(fi->q.ptr_sest[fi->g.scsi_oxid], &fi->g.inb_sest_entry, sizeof(INB_SEST_ENTRY));
4285 fi->g.outb_sest_entry.flags_and_did = htonl(OUTB_SEST_VED | ni->d_id);
4286 fi->g.outb_sest_entry.max_frame_len = htons(ni->mtu << 4);
4287 fi->g.outb_sest_entry.cntl = htons(ODB_CLASS_3 | ODB_EE_CREDIT | ODB_NO_INT | ODB_NO_COMP);
4288 fi->g.outb_sest_entry.total_seq_length = INV_SEQ_LEN;
4289 fi->g.outb_sest_entry.link = htons(OUTB_SEST_LINK);
4290 fi->g.outb_sest_entry.transaction_id = htonl(fi->g.scsi_oxid);
4291 fi->g.outb_sest_entry.seq_id = fi->g.seq_id;
4292 fi->g.outb_sest_entry.reserved = 0x0;
4293 fi->g.outb_sest_entry.header_length = htons(TACHYON_HEADER_LEN);
4304 …build_tachyon_header(fi, fi->g.my_id, r_ctl, ni->d_id, type, fi->g.seq_id, df_ctl, fi->g.scsi_oxid…
4307 …memcpy(fi->q.ptr_tachyon_header[fi->q.tachyon_header_indx], &(fi->g.tach_header), TACHYON_HEADER_L…
4308 …fi->g.outb_sest_entry.header_address = htonl(virt_to_bus(fi->q.ptr_tachyon_header[fi->q.tachyon_he…
4348 fi->g.outb_sest_entry.edb_address = htonl(virt_to_bus(fi->q.ptr_edb[fi->q.edb_buffer_indx]));
4355 memcpy(fi->q.ptr_edb[fi->q.edb_buffer_indx], &(fi->g.edb), sizeof(EDB));
4370 memcpy(fi->q.ptr_edb[fi->q.edb_buffer_indx], &(fi->g.edb), sizeof(EDB));
4383 fi->g.outb_sest_entry.edb_address = htonl(virt_to_bus(fi->q.ptr_edb[fi->q.edb_buffer_indx]));
4387 memcpy(fi->q.ptr_edb[fi->q.edb_buffer_indx], &(fi->g.edb), sizeof(EDB));
4402 memcpy(fi->q.ptr_edb[fi->q.edb_buffer_indx], &(fi->g.edb), sizeof(EDB));
4415 memcpy(fi->q.ptr_sest[fi->g.scsi_oxid], &fi->g.outb_sest_entry, sizeof(OUTB_SEST_ENTRY));
4430 u_short initial_oxid = fi->g.scsi_oxid;
4434 while (fi->q.free_scsi_oxid[fi->g.scsi_oxid] != OXID_AVAILABLE) {
4436 if (fi->g.scsi_oxid == initial_oxid) {
4447 fi->g.scsi_oxid++;
4448 if (fi->g.scsi_oxid == (MAX_SCSI_XID + 1))
4449 fi->g.scsi_oxid = 0;
4483 iounmap(fi->g.mem_base);
4555 fc[i]->g.dont_init = TRUE;
4624 if(fi->g.tachyon_base == 0)
4627 fi->i_r.ptr_ichip_hw_control_reg = ICHIP_HW_CONTROL_REG_OFF + fi->g.tachyon_base;
4628 fi->i_r.ptr_ichip_hw_status_reg = ICHIP_HW_STATUS_REG_OFF + fi->g.tachyon_base;
4629 fi->i_r.ptr_ichip_hw_addr_mask_reg = ICHIP_HW_ADDR_MASK_REG_OFF + fi->g.tachyon_base;
4630 fi->t_r.ptr_ocq_base_reg = OCQ_BASE_REGISTER_OFFSET + fi->g.tachyon_base;
4631 fi->t_r.ptr_ocq_len_reg = OCQ_LENGTH_REGISTER_OFFSET + fi->g.tachyon_base;
4632 fi->t_r.ptr_ocq_prod_indx_reg = OCQ_PRODUCER_REGISTER_OFFSET + fi->g.tachyon_base;
4633 fi->t_r.ptr_ocq_cons_indx_reg = OCQ_CONSUMER_REGISTER_OFFSET + fi->g.tachyon_base;
4634 fi->t_r.ptr_imq_base_reg = IMQ_BASE_REGISTER_OFFSET + fi->g.tachyon_base;
4635 fi->t_r.ptr_imq_len_reg = IMQ_LENGTH_REGISTER_OFFSET + fi->g.tachyon_base;
4636 fi->t_r.ptr_imq_cons_indx_reg = IMQ_CONSUMER_REGISTER_OFFSET + fi->g.tachyon_base;
4637 fi->t_r.ptr_imq_prod_indx_reg = IMQ_PRODUCER_REGISTER_OFFSET + fi->g.tachyon_base;
4638 fi->t_r.ptr_mfsbq_base_reg = MFSBQ_BASE_REGISTER_OFFSET + fi->g.tachyon_base;
4639 fi->t_r.ptr_mfsbq_len_reg = MFSBQ_LENGTH_REGISTER_OFFSET + fi->g.tachyon_base;
4640 fi->t_r.ptr_mfsbq_prod_reg = MFSBQ_PRODUCER_REGISTER_OFFSET + fi->g.tachyon_base;
4641 fi->t_r.ptr_mfsbq_cons_reg = MFSBQ_CONSUMER_REGISTER_OFFSET + fi->g.tachyon_base;
4642 fi->t_r.ptr_mfsbuff_len_reg = MFS_LENGTH_REGISTER_OFFSET + fi->g.tachyon_base;
4643 fi->t_r.ptr_sfsbq_base_reg = SFSBQ_BASE_REGISTER_OFFSET + fi->g.tachyon_base;
4644 fi->t_r.ptr_sfsbq_len_reg = SFSBQ_LENGTH_REGISTER_OFFSET + fi->g.tachyon_base;
4645 fi->t_r.ptr_sfsbq_prod_reg = SFSBQ_PRODUCER_REGISTER_OFFSET + fi->g.tachyon_base;
4646 fi->t_r.ptr_sfsbq_cons_reg = SFSBQ_CONSUMER_REGISTER_OFFSET + fi->g.tachyon_base;
4647 fi->t_r.ptr_sfsbuff_len_reg = SFS_LENGTH_REGISTER_OFFSET + fi->g.tachyon_base;
4648 fi->t_r.ptr_sest_base_reg = SEST_BASE_REGISTER_OFFSET + fi->g.tachyon_base;
4649 fi->t_r.ptr_sest_len_reg = SEST_LENGTH_REGISTER_OFFSET + fi->g.tachyon_base;
4650 fi->t_r.ptr_scsibuff_len_reg = SCSI_LENGTH_REGISTER_OFFSET + fi->g.tachyon_base;
4651 fi->t_r.ptr_tach_config_reg = TACHYON_CONFIG_REGISTER_OFFSET + fi->g.tachyon_base;
4652 fi->t_r.ptr_tach_control_reg = TACHYON_CONTROL_REGISTER_OFFSET + fi->g.tachyon_base;
4653 fi->t_r.ptr_tach_status_reg = TACHYON_STATUS_REGISTER_OFFSET + fi->g.tachyon_base;
4654 fi->t_r.ptr_tach_flush_oxid_reg = TACHYON_FLUSH_SEST_REGISTER_OFFSET + fi->g.tachyon_base;
4655 fi->t_r.ptr_fm_config_reg = FMGR_CONFIG_REGISTER_OFFSET + fi->g.tachyon_base;
4656 fi->t_r.ptr_fm_control_reg = FMGR_CONTROL_REGISTER_OFFSET + fi->g.tachyon_base;
4657 fi->t_r.ptr_fm_status_reg = FMGR_STATUS_REGISTER_OFFSET + fi->g.tachyon_base;
4658 fi->t_r.ptr_fm_tov_reg = FMGR_TIMER_REGISTER_OFFSET + fi->g.tachyon_base;
4659 fi->t_r.ptr_fm_wwn_hi_reg = FMGR_WWN_HI_REGISTER_OFFSET + fi->g.tachyon_base;
4660 fi->t_r.ptr_fm_wwn_low_reg = FMGR_WWN_LO_REGISTER_OFFSET + fi->g.tachyon_base;
4661 fi->t_r.ptr_fm_rx_al_pa_reg = FMGR_RCVD_ALPA_REGISTER_OFFSET + fi->g.tachyon_base;