Lines Matching refs:parent

95 	spin_lock_irqsave(&np->parent->lock, flags)
97 spin_unlock_irqrestore(&np->parent->lock, flags)
253 struct niu_parent *parent = np->parent;
259 if (parent->ldg_map[i] != lp->ldg_num)
1605 /* XXX shared resource, lock parent XXX */
1610 phy_id = phy_decode(np->parent->port_phy, np->port);
1611 phy_id = np->parent->phy_probe_info.phy_id[phy_id][np->port];
1852 /* XXX shared resource, lock parent XXX */
2084 phy_id = phy_decode(np->parent->port_phy, np->port);
2085 phy_id = np->parent->phy_probe_info.phy_id[phy_id][np->port];
2481 struct niu_parent *parent = np->parent;
2482 u8 plat_type = parent->plat_type;
2587 struct niu_parent *parent = np->parent;
2590 if (parent->plat_type == PLAT_TYPE_NIU) {
3003 for (i = 0; i < np->parent->tcam_num_entries; i++) {
3162 struct niu_parent *parent;
3168 parent = np->parent;
3170 if (!(parent->flags & PARENT_FLGS_CLS_HWINIT)) {
3171 if (np->parent->plat_type != PLAT_TYPE_NIU) {
3200 if (np->parent->plat_type != PLAT_TYPE_NIU) {
3212 parent->flags |= PARENT_FLGS_CLS_HWINIT;
3245 return np->clas.tcam_top + ((idx+1) * np->parent->num_ports);
4148 struct niu_parent *parent = np->parent;
4159 if (parent->ldg_map[ldn] != ldg)
4171 if (parent->ldg_map[ldn] != ldg)
4452 struct niu_parent *parent = np->parent;
4462 first_rx_channel += parent->rxchan_per_port[i];
4463 first_tx_channel += parent->txchan_per_port[i];
4466 num_rx_rings = parent->rxchan_per_port[port];
4467 num_tx_rings = parent->txchan_per_port[port];
4709 struct niu_rdc_tables *tp = &np->parent->rdc_group_cfg[np->port];
4722 nw64(DEF_RDC(np->port), np->parent->rdc_default[np->port]);
4727 int type = phy_decode(np->parent->port_phy, np->port);
4745 struct niu_parent *parent = np->parent;
4746 struct niu_rdc_tables *tp = &parent->rdc_group_cfg[np->port];
4966 nw64(RX_DMA_CK_DIV, np->parent->rxdma_clock_divider);
4992 struct niu_parent *parent = np->parent;
4998 tp = &parent->tcam[index];
5022 struct niu_parent *parent = np->parent;
5052 err = niu_set_tcam_key(np, i, parent->tcam_key[index]);
5055 err = niu_set_flow_key(np, i, parent->flow_key[index]);
5137 if (np->parent->plat_type != PLAT_TYPE_NIU) {
5204 if (np->parent->plat_type != PLAT_TYPE_NIU) {
5617 struct niu_parent *parent = np->parent;
5618 struct niu_rdc_tables *tp = &parent->rdc_group_cfg[np->port];
5669 struct niu_parent *parent = np->parent;
5670 struct niu_rdc_tables *tp = &parent->rdc_group_cfg[np->port];
6787 if (np->parent->plat_type != PLAT_TYPE_NIU)
7065 if (np->parent->tcam_key[class - CLASS_CODE_USER_PROG1] &
7069 nfc->data = niu_flowkey_to_ethflow(np->parent->flow_key[class -
7153 struct niu_parent *parent = np->parent;
7162 tp = &parent->tcam[idx];
7165 parent->index, (u16)nfc->fs.location, idx);
7175 parent->index);
7233 struct niu_parent *parent = np->parent;
7245 tp = &parent->tcam[idx];
7307 flow_key = np->parent->tcam_key[class -
7311 np->parent->tcam_key[class - CLASS_CODE_USER_PROG1] = flow_key;
7316 if (np->parent->tcam_key[class - CLASS_CODE_USER_PROG1] &
7319 flow_key = np->parent->tcam_key[class -
7324 np->parent->tcam_key[class - CLASS_CODE_USER_PROG1] =
7335 np->parent->flow_key[class - CLASS_CODE_USER_PROG1] = flow_key;
7412 struct niu_parent *parent = np->parent;
7415 struct niu_rdc_tables *rdc_table = &parent->rdc_group_cfg[np->port];
7440 if (parent->l3_cls[i]) {
7441 if (uspec->proto == parent->l3_cls_pid[i]) {
7442 class = parent->l3_cls[i];
7443 parent->l3_cls_refcnt[i]++;
7476 parent->l3_cls[i] = class;
7477 parent->l3_cls_pid[i] = uspec->proto;
7478 parent->l3_cls_refcnt[i]++;
7485 parent->index, __func__, uspec->proto);
7499 tp = &parent->tcam[idx];
7519 parent->index, __func__, fsp->flow_type);
7527 parent->index, __func__, fsp->flow_type);
7538 parent->index, __func__,
7570 struct niu_parent *parent = np->parent;
7583 tp = &parent->tcam[idx];
7592 if (parent->l3_cls[i] == class) {
7593 parent->l3_cls_refcnt[i]--;
7594 if (!parent->l3_cls_refcnt[i]) {
7601 parent->l3_cls[i] = 0;
7602 parent->l3_cls_pid[i] = 0;
7609 parent->index, __func__,
7895 static int niu_ldg_assign_ldn(struct niu *np, struct niu_parent *parent,
7903 parent->ldg_map[ldn] = ldg;
7905 if (np->parent->plat_type == PLAT_TYPE_NIU) {
8513 struct niu_parent *parent = np->parent;
8518 if (!parent->num_ports) {
8519 if (parent->plat_type == PLAT_TYPE_NIU) {
8520 parent->num_ports = 2;
8522 parent->num_ports = niu_pci_vpd_get_nports(np);
8523 if (!parent->num_ports) {
8527 parent->num_ports = nr64(ESPC_NUM_PORTS_MACS) &
8533 if (!parent->num_ports)
8534 parent->num_ports = 4;
8539 if (np->port >= parent->num_ports)
8545 static int phy_record(struct niu_parent *parent, struct phy_probe_info *p,
8566 parent->index, id,
8624 static void niu_n2_divide_channels(struct niu_parent *parent)
8626 int num_ports = parent->num_ports;
8630 parent->rxchan_per_port[i] = (16 / num_ports);
8631 parent->txchan_per_port[i] = (16 / num_ports);
8634 parent->index, i,
8635 parent->rxchan_per_port[i],
8636 parent->txchan_per_port[i]);
8640 static void niu_divide_channels(struct niu_parent *parent,
8643 int num_ports = parent->num_ports;
8667 int type = phy_decode(parent->port_phy, i);
8670 parent->rxchan_per_port[i] = rx_chans_per_10g;
8671 parent->txchan_per_port[i] = tx_chans_per_10g;
8673 parent->rxchan_per_port[i] = rx_chans_per_1g;
8674 parent->txchan_per_port[i] = tx_chans_per_1g;
8677 parent->index, i,
8678 parent->rxchan_per_port[i],
8679 parent->txchan_per_port[i]);
8680 tot_rx += parent->rxchan_per_port[i];
8681 tot_tx += parent->txchan_per_port[i];
8686 parent->index, tot_rx);
8688 parent->rxchan_per_port[i] = 1;
8692 parent->index, tot_tx);
8694 parent->txchan_per_port[i] = 1;
8698 parent->index, tot_rx, tot_tx);
8702 static void niu_divide_rdc_groups(struct niu_parent *parent,
8705 int i, num_ports = parent->num_ports;
8715 struct niu_rdc_tables *tp = &parent->rdc_group_cfg[i];
8716 int grp, num_channels = parent->rxchan_per_port[i];
8727 parent->index, i, tp->first_table_num + grp);
8740 parent->rdc_default[i] = rdc_channel_base;
8747 static int fill_phy_probe_info(struct niu *np, struct niu_parent *parent,
8765 err = phy_record(parent, info, dev_id_1, dev_id_2, port,
8773 err = phy_record(parent, info, dev_id_1, dev_id_2, port,
8779 err = phy_record(parent, info, dev_id_1, dev_id_2, port,
8789 static int walk_phys(struct niu *np, struct niu_parent *parent)
8791 struct phy_probe_info *info = &parent->phy_probe_info;
8803 parent->plat_type = PLAT_TYPE_ATCA_CP3220;
8804 parent->num_ports = 4;
8812 parent->num_ports = 2;
8816 (parent->plat_type == PLAT_TYPE_NIU)) {
8826 err = fill_phy_probe_info(np, parent, info);
8836 parent->plat_type = PLAT_TYPE_VF_P0;
8838 parent->plat_type = PLAT_TYPE_VF_P1;
8861 parent->plat_type = PLAT_TYPE_VF_P0;
8863 parent->plat_type = PLAT_TYPE_VF_P1;
8883 parent->plat_type = PLAT_TYPE_VF_P0;
8885 parent->plat_type = PLAT_TYPE_VF_P1;
8902 parent->port_phy = val;
8904 if (parent->plat_type == PLAT_TYPE_NIU)
8905 niu_n2_divide_channels(parent);
8907 niu_divide_channels(parent, num_10g, num_1g);
8909 niu_divide_rdc_groups(parent, num_10g, num_1g);
8920 struct niu_parent *parent = np->parent;
8923 if (parent->port_phy == PORT_PHY_UNKNOWN) {
8924 err = walk_phys(np, parent);
8933 if (parent->port_phy == PORT_PHY_INVALID)
8944 cp->tcam_sz = np->parent->tcam_num_entries / np->parent->num_ports;
9018 struct niu_parent *parent = np->parent;
9023 first_ldg = (NIU_NUM_LDG / parent->num_ports) * np->port;
9024 for (i = 0; i < (NIU_NUM_LDG / parent->num_ports); i++)
9027 num_irqs = (parent->rxchan_per_port[np->port] +
9028 parent->txchan_per_port[np->port] +
9030 BUG_ON(num_irqs > (NIU_NUM_LDG / parent->num_ports));
9075 struct niu_parent *parent = np->parent;
9083 if (parent->plat_type == PLAT_TYPE_NIU) {
9104 if (np->parent->plat_type != PLAT_TYPE_NIU) {
9124 err = niu_ldg_assign_ldn(np, parent, ldg_num_map[ldg_rotor],
9134 err = niu_ldg_assign_ldn(np, parent,
9144 err = niu_ldg_assign_ldn(np, parent,
9158 first_chan += parent->rxchan_per_port[i];
9159 num_chan = parent->rxchan_per_port[port];
9162 err = niu_ldg_assign_ldn(np, parent,
9174 first_chan += parent->txchan_per_port[i];
9175 num_chan = parent->txchan_per_port[port];
9177 err = niu_ldg_assign_ldn(np, parent,
9206 if (np->parent->plat_type == PLAT_TYPE_NIU)
9282 if (np->parent->plat_type == PLAT_TYPE_NIU)
9544 struct niu_parent *p = np->parent;
9560 np->parent = NULL;
9689 if (np->parent->plat_type == PLAT_TYPE_ATCA_CP3220) {
9767 np->parent = niu_get_parent(np, &parent_id,
9769 if (!np->parent) {
10033 np->parent = niu_get_parent(np, &parent_id,
10035 if (!np->parent) {