Lines Matching refs:parent
114 spin_lock_irqsave(&np->parent->lock, flags)
116 spin_unlock_irqrestore(&np->parent->lock, flags)
272 struct niu_parent *parent = np->parent;
278 if (parent->ldg_map[i] != lp->ldg_num)
1624 /* XXX shared resource, lock parent XXX */
1629 phy_id = phy_decode(np->parent->port_phy, np->port);
1630 phy_id = np->parent->phy_probe_info.phy_id[phy_id][np->port];
1871 /* XXX shared resource, lock parent XXX */
2103 phy_id = phy_decode(np->parent->port_phy, np->port);
2104 phy_id = np->parent->phy_probe_info.phy_id[phy_id][np->port];
2500 struct niu_parent *parent = np->parent;
2501 u8 plat_type = parent->plat_type;
2606 struct niu_parent *parent = np->parent;
2609 if (parent->plat_type == PLAT_TYPE_NIU) {
3022 for (i = 0; i < np->parent->tcam_num_entries; i++) {
3181 struct niu_parent *parent;
3187 parent = np->parent;
3189 if (!(parent->flags & PARENT_FLGS_CLS_HWINIT)) {
3190 if (np->parent->plat_type != PLAT_TYPE_NIU) {
3219 if (np->parent->plat_type != PLAT_TYPE_NIU) {
3231 parent->flags |= PARENT_FLGS_CLS_HWINIT;
3264 return np->clas.tcam_top + ((idx+1) * np->parent->num_ports);
4167 struct niu_parent *parent = np->parent;
4178 if (parent->ldg_map[ldn] != ldg)
4190 if (parent->ldg_map[ldn] != ldg)
4471 struct niu_parent *parent = np->parent;
4481 first_rx_channel += parent->rxchan_per_port[i];
4482 first_tx_channel += parent->txchan_per_port[i];
4485 num_rx_rings = parent->rxchan_per_port[port];
4486 num_tx_rings = parent->txchan_per_port[port];
4728 struct niu_rdc_tables *tp = &np->parent->rdc_group_cfg[np->port];
4741 nw64(DEF_RDC(np->port), np->parent->rdc_default[np->port]);
4746 int type = phy_decode(np->parent->port_phy, np->port);
4764 struct niu_parent *parent = np->parent;
4765 struct niu_rdc_tables *tp = &parent->rdc_group_cfg[np->port];
4985 nw64(RX_DMA_CK_DIV, np->parent->rxdma_clock_divider);
5011 struct niu_parent *parent = np->parent;
5017 tp = &parent->tcam[index];
5041 struct niu_parent *parent = np->parent;
5071 err = niu_set_tcam_key(np, i, parent->tcam_key[index]);
5074 err = niu_set_flow_key(np, i, parent->flow_key[index]);
5156 if (np->parent->plat_type != PLAT_TYPE_NIU) {
5223 if (np->parent->plat_type != PLAT_TYPE_NIU) {
5636 struct niu_parent *parent = np->parent;
5637 struct niu_rdc_tables *tp = &parent->rdc_group_cfg[np->port];
5688 struct niu_parent *parent = np->parent;
5689 struct niu_rdc_tables *tp = &parent->rdc_group_cfg[np->port];
6805 if (np->parent->plat_type != PLAT_TYPE_NIU)
7083 if (np->parent->tcam_key[class - CLASS_CODE_USER_PROG1] &
7087 nfc->data = niu_flowkey_to_ethflow(np->parent->flow_key[class -
7171 struct niu_parent *parent = np->parent;
7180 tp = &parent->tcam[idx];
7183 parent->index, (u16)nfc->fs.location, idx);
7193 parent->index);
7251 struct niu_parent *parent = np->parent;
7263 tp = &parent->tcam[idx];
7325 flow_key = np->parent->tcam_key[class -
7329 np->parent->tcam_key[class - CLASS_CODE_USER_PROG1] = flow_key;
7334 if (np->parent->tcam_key[class - CLASS_CODE_USER_PROG1] &
7337 flow_key = np->parent->tcam_key[class -
7342 np->parent->tcam_key[class - CLASS_CODE_USER_PROG1] =
7353 np->parent->flow_key[class - CLASS_CODE_USER_PROG1] = flow_key;
7430 struct niu_parent *parent = np->parent;
7433 struct niu_rdc_tables *rdc_table = &parent->rdc_group_cfg[np->port];
7458 if (parent->l3_cls[i]) {
7459 if (uspec->proto == parent->l3_cls_pid[i]) {
7460 class = parent->l3_cls[i];
7461 parent->l3_cls_refcnt[i]++;
7494 parent->l3_cls[i] = class;
7495 parent->l3_cls_pid[i] = uspec->proto;
7496 parent->l3_cls_refcnt[i]++;
7503 parent->index, __func__, uspec->proto);
7517 tp = &parent->tcam[idx];
7537 parent->index, __func__, fsp->flow_type);
7545 parent->index, __func__, fsp->flow_type);
7556 parent->index, __func__,
7588 struct niu_parent *parent = np->parent;
7601 tp = &parent->tcam[idx];
7610 if (parent->l3_cls[i] == class) {
7611 parent->l3_cls_refcnt[i]--;
7612 if (!parent->l3_cls_refcnt[i]) {
7619 parent->l3_cls[i] = 0;
7620 parent->l3_cls_pid[i] = 0;
7627 parent->index, __func__,
7913 static int niu_ldg_assign_ldn(struct niu *np, struct niu_parent *parent,
7921 parent->ldg_map[ldn] = ldg;
7923 if (np->parent->plat_type == PLAT_TYPE_NIU) {
8537 struct niu_parent *parent = np->parent;
8542 if (!parent->num_ports) {
8543 if (parent->plat_type == PLAT_TYPE_NIU) {
8544 parent->num_ports = 2;
8546 parent->num_ports = niu_pci_vpd_get_nports(np);
8547 if (!parent->num_ports) {
8551 parent->num_ports = nr64(ESPC_NUM_PORTS_MACS) &
8557 if (!parent->num_ports)
8558 parent->num_ports = 4;
8563 if (np->port >= parent->num_ports)
8569 static int phy_record(struct niu_parent *parent, struct phy_probe_info *p,
8590 parent->index, id,
8648 static void niu_n2_divide_channels(struct niu_parent *parent)
8650 int num_ports = parent->num_ports;
8654 parent->rxchan_per_port[i] = (16 / num_ports);
8655 parent->txchan_per_port[i] = (16 / num_ports);
8658 parent->index, i,
8659 parent->rxchan_per_port[i],
8660 parent->txchan_per_port[i]);
8664 static void niu_divide_channels(struct niu_parent *parent,
8667 int num_ports = parent->num_ports;
8691 int type = phy_decode(parent->port_phy, i);
8694 parent->rxchan_per_port[i] = rx_chans_per_10g;
8695 parent->txchan_per_port[i] = tx_chans_per_10g;
8697 parent->rxchan_per_port[i] = rx_chans_per_1g;
8698 parent->txchan_per_port[i] = tx_chans_per_1g;
8701 parent->index, i,
8702 parent->rxchan_per_port[i],
8703 parent->txchan_per_port[i]);
8704 tot_rx += parent->rxchan_per_port[i];
8705 tot_tx += parent->txchan_per_port[i];
8710 parent->index, tot_rx);
8712 parent->rxchan_per_port[i] = 1;
8716 parent->index, tot_tx);
8718 parent->txchan_per_port[i] = 1;
8722 parent->index, tot_rx, tot_tx);
8726 static void niu_divide_rdc_groups(struct niu_parent *parent,
8729 int i, num_ports = parent->num_ports;
8739 struct niu_rdc_tables *tp = &parent->rdc_group_cfg[i];
8740 int grp, num_channels = parent->rxchan_per_port[i];
8751 parent->index, i, tp->first_table_num + grp);
8764 parent->rdc_default[i] = rdc_channel_base;
8771 static int fill_phy_probe_info(struct niu *np, struct niu_parent *parent,
8789 err = phy_record(parent, info, dev_id_1, dev_id_2, port,
8797 err = phy_record(parent, info, dev_id_1, dev_id_2, port,
8803 err = phy_record(parent, info, dev_id_1, dev_id_2, port,
8813 static int walk_phys(struct niu *np, struct niu_parent *parent)
8815 struct phy_probe_info *info = &parent->phy_probe_info;
8827 parent->plat_type = PLAT_TYPE_ATCA_CP3220;
8828 parent->num_ports = 4;
8836 parent->num_ports = 2;
8840 (parent->plat_type == PLAT_TYPE_NIU)) {
8850 err = fill_phy_probe_info(np, parent, info);
8860 parent->plat_type = PLAT_TYPE_VF_P0;
8862 parent->plat_type = PLAT_TYPE_VF_P1;
8885 parent->plat_type = PLAT_TYPE_VF_P0;
8887 parent->plat_type = PLAT_TYPE_VF_P1;
8907 parent->plat_type = PLAT_TYPE_VF_P0;
8909 parent->plat_type = PLAT_TYPE_VF_P1;
8926 parent->port_phy = val;
8928 if (parent->plat_type == PLAT_TYPE_NIU)
8929 niu_n2_divide_channels(parent);
8931 niu_divide_channels(parent, num_10g, num_1g);
8933 niu_divide_rdc_groups(parent, num_10g, num_1g);
8944 struct niu_parent *parent = np->parent;
8947 if (parent->port_phy == PORT_PHY_UNKNOWN) {
8948 err = walk_phys(np, parent);
8957 if (parent->port_phy == PORT_PHY_INVALID)
8968 cp->tcam_sz = np->parent->tcam_num_entries / np->parent->num_ports;
9042 struct niu_parent *parent = np->parent;
9047 first_ldg = (NIU_NUM_LDG / parent->num_ports) * np->port;
9048 for (i = 0; i < (NIU_NUM_LDG / parent->num_ports); i++)
9051 num_irqs = (parent->rxchan_per_port[np->port] +
9052 parent->txchan_per_port[np->port] +
9054 BUG_ON(num_irqs > (NIU_NUM_LDG / parent->num_ports));
9099 struct niu_parent *parent = np->parent;
9107 if (parent->plat_type == PLAT_TYPE_NIU) {
9128 if (np->parent->plat_type != PLAT_TYPE_NIU) {
9148 err = niu_ldg_assign_ldn(np, parent, ldg_num_map[ldg_rotor],
9158 err = niu_ldg_assign_ldn(np, parent,
9168 err = niu_ldg_assign_ldn(np, parent,
9182 first_chan += parent->rxchan_per_port[i];
9183 num_chan = parent->rxchan_per_port[port];
9186 err = niu_ldg_assign_ldn(np, parent,
9198 first_chan += parent->txchan_per_port[i];
9199 num_chan = parent->txchan_per_port[port];
9201 err = niu_ldg_assign_ldn(np, parent,
9230 if (np->parent->plat_type == PLAT_TYPE_NIU)
9306 if (np->parent->plat_type == PLAT_TYPE_NIU)
9568 struct niu_parent *p = np->parent;
9584 np->parent = NULL;
9713 if (np->parent->plat_type == PLAT_TYPE_ATCA_CP3220) {
9790 np->parent = niu_get_parent(np, &parent_id,
9792 if (!np->parent) {
10049 np->parent = niu_get_parent(np, &parent_id,
10051 if (!np->parent) {