ag                677 drivers/infiniband/core/security.c 	struct ib_mad_agent *ag;
ag                680 drivers/infiniband/core/security.c 	list_for_each_entry(ag,
ag                683 drivers/infiniband/core/security.c 		WRITE_ONCE(ag->smp_allowed,
ag                684 drivers/infiniband/core/security.c 			   !security_ib_endport_manage_subnet(ag->security,
ag                685 drivers/infiniband/core/security.c 				dev_name(&ag->device->dev), ag->port_num));
ag               4252 drivers/infiniband/hw/hfi1/mad.c static inline void set_aggr_error(struct opa_aggregate *ag)
ag               4254 drivers/infiniband/hw/hfi1/mad.c 	ag->err_reqlength |= cpu_to_be16(0x8000);
ag                347 drivers/net/ethernet/atheros/ag71xx.c static bool ag71xx_is(struct ag71xx *ag, enum ag71xx_type type)
ag                349 drivers/net/ethernet/atheros/ag71xx.c 	return ag->dcfg->type == type;
ag                352 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_wr(struct ag71xx *ag, unsigned int reg, u32 value)
ag                354 drivers/net/ethernet/atheros/ag71xx.c 	iowrite32(value, ag->mac_base + reg);
ag                356 drivers/net/ethernet/atheros/ag71xx.c 	(void)ioread32(ag->mac_base + reg);
ag                359 drivers/net/ethernet/atheros/ag71xx.c static u32 ag71xx_rr(struct ag71xx *ag, unsigned int reg)
ag                361 drivers/net/ethernet/atheros/ag71xx.c 	return ioread32(ag->mac_base + reg);
ag                364 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_sb(struct ag71xx *ag, unsigned int reg, u32 mask)
ag                368 drivers/net/ethernet/atheros/ag71xx.c 	r = ag->mac_base + reg;
ag                374 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_cb(struct ag71xx *ag, unsigned int reg, u32 mask)
ag                378 drivers/net/ethernet/atheros/ag71xx.c 	r = ag->mac_base + reg;
ag                384 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_int_enable(struct ag71xx *ag, u32 ints)
ag                386 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_sb(ag, AG71XX_REG_INT_ENABLE, ints);
ag                389 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_int_disable(struct ag71xx *ag, u32 ints)
ag                391 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_cb(ag, AG71XX_REG_INT_ENABLE, ints);
ag                394 drivers/net/ethernet/atheros/ag71xx.c static int ag71xx_mdio_wait_busy(struct ag71xx *ag)
ag                396 drivers/net/ethernet/atheros/ag71xx.c 	struct net_device *ndev = ag->ndev;
ag                404 drivers/net/ethernet/atheros/ag71xx.c 		busy = ag71xx_rr(ag, AG71XX_REG_MII_IND);
ag                411 drivers/net/ethernet/atheros/ag71xx.c 	netif_err(ag, link, ndev, "MDIO operation timed out\n");
ag                418 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx *ag = bus->priv;
ag                421 drivers/net/ethernet/atheros/ag71xx.c 	err = ag71xx_mdio_wait_busy(ag);
ag                425 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MII_ADDR,
ag                428 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MII_CMD, MII_CMD_READ);
ag                430 drivers/net/ethernet/atheros/ag71xx.c 	err = ag71xx_mdio_wait_busy(ag);
ag                434 drivers/net/ethernet/atheros/ag71xx.c 	val = ag71xx_rr(ag, AG71XX_REG_MII_STATUS);
ag                436 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MII_CMD, 0);
ag                438 drivers/net/ethernet/atheros/ag71xx.c 	netif_dbg(ag, link, ag->ndev, "mii_read: addr=%04x, reg=%04x, value=%04x\n",
ag                447 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx *ag = bus->priv;
ag                449 drivers/net/ethernet/atheros/ag71xx.c 	netif_dbg(ag, link, ag->ndev, "mii_write: addr=%04x, reg=%04x, value=%04x\n",
ag                452 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MII_ADDR,
ag                454 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MII_CTRL, val);
ag                456 drivers/net/ethernet/atheros/ag71xx.c 	return ag71xx_mdio_wait_busy(ag);
ag                471 drivers/net/ethernet/atheros/ag71xx.c static int ag71xx_mdio_get_divider(struct ag71xx *ag, u32 *div)
ag                477 drivers/net/ethernet/atheros/ag71xx.c 	ref_clock = clk_get_rate(ag->clk_mdio);
ag                481 drivers/net/ethernet/atheros/ag71xx.c 	if (ag71xx_is(ag, AR9330) || ag71xx_is(ag, AR9340)) {
ag                484 drivers/net/ethernet/atheros/ag71xx.c 	} else if (ag71xx_is(ag, AR7240)) {
ag                507 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx *ag = bus->priv;
ag                511 drivers/net/ethernet/atheros/ag71xx.c 	err = ag71xx_mdio_get_divider(ag, &t);
ag                515 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MII_CFG, t | MII_CFG_RESET);
ag                518 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MII_CFG, t);
ag                524 drivers/net/ethernet/atheros/ag71xx.c static int ag71xx_mdio_probe(struct ag71xx *ag)
ag                526 drivers/net/ethernet/atheros/ag71xx.c 	struct device *dev = &ag->pdev->dev;
ag                527 drivers/net/ethernet/atheros/ag71xx.c 	struct net_device *ndev = ag->ndev;
ag                533 drivers/net/ethernet/atheros/ag71xx.c 	ag->mii_bus = NULL;
ag                535 drivers/net/ethernet/atheros/ag71xx.c 	ag->clk_mdio = devm_clk_get(dev, "mdio");
ag                536 drivers/net/ethernet/atheros/ag71xx.c 	if (IS_ERR(ag->clk_mdio)) {
ag                537 drivers/net/ethernet/atheros/ag71xx.c 		netif_err(ag, probe, ndev, "Failed to get mdio clk.\n");
ag                538 drivers/net/ethernet/atheros/ag71xx.c 		return PTR_ERR(ag->clk_mdio);
ag                541 drivers/net/ethernet/atheros/ag71xx.c 	err = clk_prepare_enable(ag->clk_mdio);
ag                543 drivers/net/ethernet/atheros/ag71xx.c 		netif_err(ag, probe, ndev, "Failed to enable mdio clk.\n");
ag                553 drivers/net/ethernet/atheros/ag71xx.c 	ag->mdio_reset = of_reset_control_get_exclusive(np, "mdio");
ag                554 drivers/net/ethernet/atheros/ag71xx.c 	if (IS_ERR(ag->mdio_reset)) {
ag                555 drivers/net/ethernet/atheros/ag71xx.c 		netif_err(ag, probe, ndev, "Failed to get reset mdio.\n");
ag                556 drivers/net/ethernet/atheros/ag71xx.c 		return PTR_ERR(ag->mdio_reset);
ag                563 drivers/net/ethernet/atheros/ag71xx.c 	mii_bus->priv = ag;
ag                565 drivers/net/ethernet/atheros/ag71xx.c 	snprintf(mii_bus->id, MII_BUS_ID_SIZE, "%s.%d", np->name, ag->mac_idx);
ag                567 drivers/net/ethernet/atheros/ag71xx.c 	if (!IS_ERR(ag->mdio_reset)) {
ag                568 drivers/net/ethernet/atheros/ag71xx.c 		reset_control_assert(ag->mdio_reset);
ag                570 drivers/net/ethernet/atheros/ag71xx.c 		reset_control_deassert(ag->mdio_reset);
ag                580 drivers/net/ethernet/atheros/ag71xx.c 	ag->mii_bus = mii_bus;
ag                585 drivers/net/ethernet/atheros/ag71xx.c 	clk_disable_unprepare(ag->clk_mdio);
ag                589 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_mdio_remove(struct ag71xx *ag)
ag                591 drivers/net/ethernet/atheros/ag71xx.c 	if (ag->mii_bus)
ag                592 drivers/net/ethernet/atheros/ag71xx.c 		mdiobus_unregister(ag->mii_bus);
ag                593 drivers/net/ethernet/atheros/ag71xx.c 	clk_disable_unprepare(ag->clk_mdio);
ag                596 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_hw_stop(struct ag71xx *ag)
ag                599 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_INT_ENABLE, 0);
ag                600 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_RX_CTRL, 0);
ag                601 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_TX_CTRL, 0);
ag                604 drivers/net/ethernet/atheros/ag71xx.c static bool ag71xx_check_dma_stuck(struct ag71xx *ag)
ag                609 drivers/net/ethernet/atheros/ag71xx.c 	timestamp = netdev_get_tx_queue(ag->ndev, 0)->trans_start;
ag                613 drivers/net/ethernet/atheros/ag71xx.c 	if (!netif_carrier_ok(ag->ndev))
ag                616 drivers/net/ethernet/atheros/ag71xx.c 	rx_sm = ag71xx_rr(ag, AG71XX_REG_RX_SM);
ag                620 drivers/net/ethernet/atheros/ag71xx.c 	tx_sm = ag71xx_rr(ag, AG71XX_REG_TX_SM);
ag                621 drivers/net/ethernet/atheros/ag71xx.c 	rx_fd = ag71xx_rr(ag, AG71XX_REG_FIFO_DEPTH);
ag                629 drivers/net/ethernet/atheros/ag71xx.c static int ag71xx_tx_packets(struct ag71xx *ag, bool flush)
ag                631 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx_ring *ring = &ag->tx_ring;
ag                633 drivers/net/ethernet/atheros/ag71xx.c 	struct net_device *ndev = ag->ndev;
ag                640 drivers/net/ethernet/atheros/ag71xx.c 	netif_dbg(ag, tx_queued, ndev, "processing TX ring\n");
ag                652 drivers/net/ethernet/atheros/ag71xx.c 			if (ag->dcfg->tx_hang_workaround &&
ag                653 drivers/net/ethernet/atheros/ag71xx.c 			    ag71xx_check_dma_stuck(ag)) {
ag                654 drivers/net/ethernet/atheros/ag71xx.c 				schedule_delayed_work(&ag->restart_work,
ag                677 drivers/net/ethernet/atheros/ag71xx.c 			ag71xx_wr(ag, AG71XX_REG_TX_STATUS, TX_STATUS_PS);
ag                682 drivers/net/ethernet/atheros/ag71xx.c 	netif_dbg(ag, tx_done, ndev, "%d packets sent out\n", sent);
ag                687 drivers/net/ethernet/atheros/ag71xx.c 	ag->ndev->stats.tx_bytes += bytes_compl;
ag                688 drivers/net/ethernet/atheros/ag71xx.c 	ag->ndev->stats.tx_packets += sent;
ag                690 drivers/net/ethernet/atheros/ag71xx.c 	netdev_completed_queue(ag->ndev, sent, bytes_compl);
ag                692 drivers/net/ethernet/atheros/ag71xx.c 		netif_wake_queue(ag->ndev);
ag                695 drivers/net/ethernet/atheros/ag71xx.c 		cancel_delayed_work(&ag->restart_work);
ag                700 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_dma_wait_stop(struct ag71xx *ag)
ag                702 drivers/net/ethernet/atheros/ag71xx.c 	struct net_device *ndev = ag->ndev;
ag                710 drivers/net/ethernet/atheros/ag71xx.c 		rx = ag71xx_rr(ag, AG71XX_REG_RX_CTRL) & RX_CTRL_RXE;
ag                711 drivers/net/ethernet/atheros/ag71xx.c 		tx = ag71xx_rr(ag, AG71XX_REG_TX_CTRL) & TX_CTRL_TXE;
ag                716 drivers/net/ethernet/atheros/ag71xx.c 	netif_err(ag, hw, ndev, "DMA stop operation timed out\n");
ag                719 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_dma_reset(struct ag71xx *ag)
ag                721 drivers/net/ethernet/atheros/ag71xx.c 	struct net_device *ndev = ag->ndev;
ag                726 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_RX_CTRL, 0);
ag                727 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_TX_CTRL, 0);
ag                732 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_dma_wait_stop(ag);
ag                735 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_TX_DESC, ag->stop_desc_dma);
ag                736 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_RX_DESC, ag->stop_desc_dma);
ag                740 drivers/net/ethernet/atheros/ag71xx.c 		ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_PR);
ag                741 drivers/net/ethernet/atheros/ag71xx.c 		ag71xx_wr(ag, AG71XX_REG_TX_STATUS, TX_STATUS_PS);
ag                745 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_BE | RX_STATUS_OF);
ag                746 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_TX_STATUS, TX_STATUS_BE | TX_STATUS_UR);
ag                748 drivers/net/ethernet/atheros/ag71xx.c 	val = ag71xx_rr(ag, AG71XX_REG_RX_STATUS);
ag                750 drivers/net/ethernet/atheros/ag71xx.c 		netif_err(ag, hw, ndev, "unable to clear DMA Rx status: %08x\n",
ag                753 drivers/net/ethernet/atheros/ag71xx.c 	val = ag71xx_rr(ag, AG71XX_REG_TX_STATUS);
ag                759 drivers/net/ethernet/atheros/ag71xx.c 		netif_err(ag, hw, ndev, "unable to clear DMA Tx status: %08x\n",
ag                763 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_hw_setup(struct ag71xx *ag)
ag                768 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, init);
ag                770 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_sb(ag, AG71XX_REG_MAC_CFG2,
ag                774 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MAC_MFL, 0);
ag                777 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_FIFO_CFG0, FIFO_CFG0_INIT);
ag                778 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_FIFO_CFG1, ag->fifodata[0]);
ag                779 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_FIFO_CFG2, ag->fifodata[1]);
ag                780 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_FIFO_CFG4, FIFO_CFG4_INIT);
ag                781 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_FIFO_CFG5, FIFO_CFG5_INIT);
ag                789 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_hw_set_macaddr(struct ag71xx *ag, unsigned char *mac)
ag                796 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MAC_ADDR1, t);
ag                799 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MAC_ADDR2, t);
ag                802 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_fast_reset(struct ag71xx *ag)
ag                804 drivers/net/ethernet/atheros/ag71xx.c 	struct net_device *dev = ag->ndev;
ag                808 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_hw_stop(ag);
ag                810 drivers/net/ethernet/atheros/ag71xx.c 	mii_reg = ag71xx_rr(ag, AG71XX_REG_MII_CFG);
ag                811 drivers/net/ethernet/atheros/ag71xx.c 	rx_ds = ag71xx_rr(ag, AG71XX_REG_RX_DESC);
ag                813 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_tx_packets(ag, true);
ag                815 drivers/net/ethernet/atheros/ag71xx.c 	reset_control_assert(ag->mac_reset);
ag                817 drivers/net/ethernet/atheros/ag71xx.c 	reset_control_deassert(ag->mac_reset);
ag                820 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_dma_reset(ag);
ag                821 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_hw_setup(ag);
ag                822 drivers/net/ethernet/atheros/ag71xx.c 	ag->tx_ring.curr = 0;
ag                823 drivers/net/ethernet/atheros/ag71xx.c 	ag->tx_ring.dirty = 0;
ag                824 drivers/net/ethernet/atheros/ag71xx.c 	netdev_reset_queue(ag->ndev);
ag                827 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MAC_MFL,
ag                828 drivers/net/ethernet/atheros/ag71xx.c 		  ag71xx_max_frame_len(ag->ndev->mtu));
ag                830 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_RX_DESC, rx_ds);
ag                831 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_TX_DESC, ag->tx_ring.descs_dma);
ag                832 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MII_CFG, mii_reg);
ag                834 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_hw_set_macaddr(ag, dev->dev_addr);
ag                837 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_hw_start(struct ag71xx *ag)
ag                840 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_RX_CTRL, RX_CTRL_RXE);
ag                843 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_INT_ENABLE, AG71XX_INT_INIT);
ag                845 drivers/net/ethernet/atheros/ag71xx.c 	netif_wake_queue(ag->ndev);
ag                848 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_link_adjust(struct ag71xx *ag, bool update)
ag                850 drivers/net/ethernet/atheros/ag71xx.c 	struct phy_device *phydev = ag->ndev->phydev;
ag                856 drivers/net/ethernet/atheros/ag71xx.c 		ag71xx_hw_stop(ag);
ag                860 drivers/net/ethernet/atheros/ag71xx.c 	if (!ag71xx_is(ag, AR7100) && !ag71xx_is(ag, AR9130))
ag                861 drivers/net/ethernet/atheros/ag71xx.c 		ag71xx_fast_reset(ag);
ag                863 drivers/net/ethernet/atheros/ag71xx.c 	cfg2 = ag71xx_rr(ag, AG71XX_REG_MAC_CFG2);
ag                867 drivers/net/ethernet/atheros/ag71xx.c 	ifctl = ag71xx_rr(ag, AG71XX_REG_MAC_IFCTL);
ag                870 drivers/net/ethernet/atheros/ag71xx.c 	fifo5 = ag71xx_rr(ag, AG71XX_REG_FIFO_CFG5);
ag                890 drivers/net/ethernet/atheros/ag71xx.c 	if (ag->tx_ring.desc_split) {
ag                891 drivers/net/ethernet/atheros/ag71xx.c 		ag->fifodata[2] &= 0xffff;
ag                892 drivers/net/ethernet/atheros/ag71xx.c 		ag->fifodata[2] |= ((2048 - ag->tx_ring.desc_split) / 4) << 16;
ag                895 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_FIFO_CFG3, ag->fifodata[2]);
ag                897 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MAC_CFG2, cfg2);
ag                898 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_FIFO_CFG5, fifo5);
ag                899 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MAC_IFCTL, ifctl);
ag                901 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_hw_start(ag);
ag                909 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx *ag = netdev_priv(ndev);
ag                911 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_link_adjust(ag, true);
ag                914 drivers/net/ethernet/atheros/ag71xx.c static int ag71xx_phy_connect(struct ag71xx *ag)
ag                916 drivers/net/ethernet/atheros/ag71xx.c 	struct device_node *np = ag->pdev->dev.of_node;
ag                917 drivers/net/ethernet/atheros/ag71xx.c 	struct net_device *ndev = ag->ndev;
ag                925 drivers/net/ethernet/atheros/ag71xx.c 			netif_err(ag, probe, ndev, "Failed to register fixed PHY link: %d\n",
ag                936 drivers/net/ethernet/atheros/ag71xx.c 		netif_err(ag, probe, ndev, "Could not find valid phy node\n");
ag                940 drivers/net/ethernet/atheros/ag71xx.c 	phydev = of_phy_connect(ag->ndev, phy_node, ag71xx_phy_link_adjust,
ag                941 drivers/net/ethernet/atheros/ag71xx.c 				0, ag->phy_if_mode);
ag                946 drivers/net/ethernet/atheros/ag71xx.c 		netif_err(ag, probe, ndev, "Could not connect to PHY device\n");
ag                955 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_ring_tx_clean(struct ag71xx *ag)
ag                957 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx_ring *ring = &ag->tx_ring;
ag                960 drivers/net/ethernet/atheros/ag71xx.c 	struct net_device *ndev = ag->ndev;
ag                987 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_ring_tx_init(struct ag71xx *ag)
ag                989 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx_ring *ring = &ag->tx_ring;
ag               1009 drivers/net/ethernet/atheros/ag71xx.c 	netdev_reset_queue(ag->ndev);
ag               1012 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_ring_rx_clean(struct ag71xx *ag)
ag               1014 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx_ring *ring = &ag->rx_ring;
ag               1023 drivers/net/ethernet/atheros/ag71xx.c 			dma_unmap_single(&ag->pdev->dev,
ag               1025 drivers/net/ethernet/atheros/ag71xx.c 					 ag->rx_buf_size, DMA_FROM_DEVICE);
ag               1030 drivers/net/ethernet/atheros/ag71xx.c static int ag71xx_buffer_size(struct ag71xx *ag)
ag               1032 drivers/net/ethernet/atheros/ag71xx.c 	return ag->rx_buf_size +
ag               1036 drivers/net/ethernet/atheros/ag71xx.c static bool ag71xx_fill_rx_buf(struct ag71xx *ag, struct ag71xx_buf *buf,
ag               1040 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx_ring *ring = &ag->rx_ring;
ag               1046 drivers/net/ethernet/atheros/ag71xx.c 	data = alloc(ag71xx_buffer_size(ag));
ag               1051 drivers/net/ethernet/atheros/ag71xx.c 	buf->rx.dma_addr = dma_map_single(&ag->pdev->dev, data, ag->rx_buf_size,
ag               1057 drivers/net/ethernet/atheros/ag71xx.c static int ag71xx_ring_rx_init(struct ag71xx *ag)
ag               1059 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx_ring *ring = &ag->rx_ring;
ag               1060 drivers/net/ethernet/atheros/ag71xx.c 	struct net_device *ndev = ag->ndev;
ag               1073 drivers/net/ethernet/atheros/ag71xx.c 		netif_dbg(ag, rx_status, ndev, "RX desc at %p, next is %08x\n",
ag               1080 drivers/net/ethernet/atheros/ag71xx.c 		if (!ag71xx_fill_rx_buf(ag, &ring->buf[i], ag->rx_buf_offset,
ag               1098 drivers/net/ethernet/atheros/ag71xx.c static int ag71xx_ring_rx_refill(struct ag71xx *ag)
ag               1100 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx_ring *ring = &ag->rx_ring;
ag               1102 drivers/net/ethernet/atheros/ag71xx.c 	int offset = ag->rx_buf_offset;
ag               1114 drivers/net/ethernet/atheros/ag71xx.c 		    !ag71xx_fill_rx_buf(ag, &ring->buf[i], offset,
ag               1125 drivers/net/ethernet/atheros/ag71xx.c 	netif_dbg(ag, rx_status, ag->ndev, "%u rx descriptors refilled\n",
ag               1131 drivers/net/ethernet/atheros/ag71xx.c static int ag71xx_rings_init(struct ag71xx *ag)
ag               1133 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx_ring *tx = &ag->tx_ring;
ag               1134 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx_ring *rx = &ag->rx_ring;
ag               1144 drivers/net/ethernet/atheros/ag71xx.c 	tx->descs_cpu = dma_alloc_coherent(&ag->pdev->dev,
ag               1157 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_ring_tx_init(ag);
ag               1158 drivers/net/ethernet/atheros/ag71xx.c 	return ag71xx_ring_rx_init(ag);
ag               1161 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_rings_free(struct ag71xx *ag)
ag               1163 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx_ring *tx = &ag->tx_ring;
ag               1164 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx_ring *rx = &ag->rx_ring;
ag               1170 drivers/net/ethernet/atheros/ag71xx.c 		dma_free_coherent(&ag->pdev->dev, ring_size * AG71XX_DESC_SIZE,
ag               1181 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_rings_cleanup(struct ag71xx *ag)
ag               1183 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_ring_rx_clean(ag);
ag               1184 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_ring_tx_clean(ag);
ag               1185 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_rings_free(ag);
ag               1187 drivers/net/ethernet/atheros/ag71xx.c 	netdev_reset_queue(ag->ndev);
ag               1190 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_hw_init(struct ag71xx *ag)
ag               1192 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_hw_stop(ag);
ag               1194 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_sb(ag, AG71XX_REG_MAC_CFG1, MAC_CFG1_SR);
ag               1197 drivers/net/ethernet/atheros/ag71xx.c 	reset_control_assert(ag->mac_reset);
ag               1199 drivers/net/ethernet/atheros/ag71xx.c 	reset_control_deassert(ag->mac_reset);
ag               1202 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_hw_setup(ag);
ag               1204 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_dma_reset(ag);
ag               1207 drivers/net/ethernet/atheros/ag71xx.c static int ag71xx_hw_enable(struct ag71xx *ag)
ag               1211 drivers/net/ethernet/atheros/ag71xx.c 	ret = ag71xx_rings_init(ag);
ag               1215 drivers/net/ethernet/atheros/ag71xx.c 	napi_enable(&ag->napi);
ag               1216 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_TX_DESC, ag->tx_ring.descs_dma);
ag               1217 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_RX_DESC, ag->rx_ring.descs_dma);
ag               1218 drivers/net/ethernet/atheros/ag71xx.c 	netif_start_queue(ag->ndev);
ag               1223 drivers/net/ethernet/atheros/ag71xx.c static void ag71xx_hw_disable(struct ag71xx *ag)
ag               1225 drivers/net/ethernet/atheros/ag71xx.c 	netif_stop_queue(ag->ndev);
ag               1227 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_hw_stop(ag);
ag               1228 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_dma_reset(ag);
ag               1230 drivers/net/ethernet/atheros/ag71xx.c 	napi_disable(&ag->napi);
ag               1231 drivers/net/ethernet/atheros/ag71xx.c 	del_timer_sync(&ag->oom_timer);
ag               1233 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_rings_cleanup(ag);
ag               1238 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx *ag = netdev_priv(ndev);
ag               1243 drivers/net/ethernet/atheros/ag71xx.c 	ag->rx_buf_size =
ag               1247 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MAC_MFL, max_frame_len);
ag               1248 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_hw_set_macaddr(ag, ndev->dev_addr);
ag               1250 drivers/net/ethernet/atheros/ag71xx.c 	ret = ag71xx_hw_enable(ag);
ag               1254 drivers/net/ethernet/atheros/ag71xx.c 	ret = ag71xx_phy_connect(ag);
ag               1263 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_rings_cleanup(ag);
ag               1269 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx *ag = netdev_priv(ndev);
ag               1273 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_hw_disable(ag);
ag               1331 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx *ag = netdev_priv(ndev);
ag               1336 drivers/net/ethernet/atheros/ag71xx.c 	ring = &ag->tx_ring;
ag               1341 drivers/net/ethernet/atheros/ag71xx.c 		netif_dbg(ag, tx_err, ndev, "packet len is too small\n");
ag               1345 drivers/net/ethernet/atheros/ag71xx.c 	dma_addr = dma_map_single(&ag->pdev->dev, skb->data, skb->len,
ag               1353 drivers/net/ethernet/atheros/ag71xx.c 				 skb->len & ag->dcfg->desc_pktlen_mask);
ag               1376 drivers/net/ethernet/atheros/ag71xx.c 		netif_dbg(ag, tx_err, ndev, "tx queue full\n");
ag               1380 drivers/net/ethernet/atheros/ag71xx.c 	netif_dbg(ag, tx_queued, ndev, "packet injected into TX queue\n");
ag               1383 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_TX_CTRL, TX_CTRL_TXE);
ag               1388 drivers/net/ethernet/atheros/ag71xx.c 	dma_unmap_single(&ag->pdev->dev, dma_addr, skb->len, DMA_TO_DEVICE);
ag               1407 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx *ag = from_timer(ag, t, oom_timer);
ag               1409 drivers/net/ethernet/atheros/ag71xx.c 	napi_schedule(&ag->napi);
ag               1414 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx *ag = netdev_priv(ndev);
ag               1416 drivers/net/ethernet/atheros/ag71xx.c 	netif_err(ag, tx_err, ndev, "tx timeout\n");
ag               1418 drivers/net/ethernet/atheros/ag71xx.c 	schedule_delayed_work(&ag->restart_work, 1);
ag               1423 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx *ag = container_of(work, struct ag71xx,
ag               1425 drivers/net/ethernet/atheros/ag71xx.c 	struct net_device *ndev = ag->ndev;
ag               1428 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_hw_disable(ag);
ag               1429 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_hw_enable(ag);
ag               1431 drivers/net/ethernet/atheros/ag71xx.c 		ag71xx_link_adjust(ag, false);
ag               1435 drivers/net/ethernet/atheros/ag71xx.c static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
ag               1437 drivers/net/ethernet/atheros/ag71xx.c 	struct net_device *ndev = ag->ndev;
ag               1444 drivers/net/ethernet/atheros/ag71xx.c 	ring = &ag->rx_ring;
ag               1445 drivers/net/ethernet/atheros/ag71xx.c 	pktlen_mask = ag->dcfg->desc_pktlen_mask;
ag               1446 drivers/net/ethernet/atheros/ag71xx.c 	offset = ag->rx_buf_offset;
ag               1450 drivers/net/ethernet/atheros/ag71xx.c 	netif_dbg(ag, rx_status, ndev, "rx packets, limit=%d, curr=%u, dirty=%u\n",
ag               1469 drivers/net/ethernet/atheros/ag71xx.c 		ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_PR);
ag               1474 drivers/net/ethernet/atheros/ag71xx.c 		dma_unmap_single(&ag->pdev->dev, ring->buf[i].rx.dma_addr,
ag               1475 drivers/net/ethernet/atheros/ag71xx.c 				 ag->rx_buf_size, DMA_FROM_DEVICE);
ag               1480 drivers/net/ethernet/atheros/ag71xx.c 		skb = build_skb(ring->buf[i].rx.rx_buf, ag71xx_buffer_size(ag));
ag               1505 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_ring_rx_refill(ag);
ag               1511 drivers/net/ethernet/atheros/ag71xx.c 	netif_dbg(ag, rx_status, ndev, "rx finish, curr=%u, dirty=%u, done=%d\n",
ag               1519 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx *ag = container_of(napi, struct ag71xx, napi);
ag               1520 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx_ring *rx_ring = &ag->rx_ring;
ag               1522 drivers/net/ethernet/atheros/ag71xx.c 	struct net_device *ndev = ag->ndev;
ag               1526 drivers/net/ethernet/atheros/ag71xx.c 	tx_done = ag71xx_tx_packets(ag, false);
ag               1528 drivers/net/ethernet/atheros/ag71xx.c 	netif_dbg(ag, rx_status, ndev, "processing RX ring\n");
ag               1529 drivers/net/ethernet/atheros/ag71xx.c 	rx_done = ag71xx_rx_packets(ag, limit);
ag               1534 drivers/net/ethernet/atheros/ag71xx.c 	status = ag71xx_rr(ag, AG71XX_REG_RX_STATUS);
ag               1536 drivers/net/ethernet/atheros/ag71xx.c 		ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_OF);
ag               1540 drivers/net/ethernet/atheros/ag71xx.c 		ag71xx_wr(ag, AG71XX_REG_RX_CTRL, RX_CTRL_RXE);
ag               1547 drivers/net/ethernet/atheros/ag71xx.c 		status = ag71xx_rr(ag, AG71XX_REG_TX_STATUS);
ag               1551 drivers/net/ethernet/atheros/ag71xx.c 		netif_dbg(ag, rx_status, ndev, "disable polling mode, rx=%d, tx=%d,limit=%d\n",
ag               1557 drivers/net/ethernet/atheros/ag71xx.c 		ag71xx_int_enable(ag, AG71XX_INT_POLL);
ag               1562 drivers/net/ethernet/atheros/ag71xx.c 	netif_dbg(ag, rx_status, ndev, "stay in polling mode, rx=%d, tx=%d, limit=%d\n",
ag               1567 drivers/net/ethernet/atheros/ag71xx.c 	netif_err(ag, rx_err, ndev, "out of memory\n");
ag               1569 drivers/net/ethernet/atheros/ag71xx.c 	mod_timer(&ag->oom_timer, jiffies + AG71XX_OOM_REFILL);
ag               1577 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx *ag;
ag               1580 drivers/net/ethernet/atheros/ag71xx.c 	ag = netdev_priv(ndev);
ag               1581 drivers/net/ethernet/atheros/ag71xx.c 	status = ag71xx_rr(ag, AG71XX_REG_INT_STATUS);
ag               1588 drivers/net/ethernet/atheros/ag71xx.c 			ag71xx_wr(ag, AG71XX_REG_TX_STATUS, TX_STATUS_BE);
ag               1589 drivers/net/ethernet/atheros/ag71xx.c 			netif_err(ag, intr, ndev, "TX BUS error\n");
ag               1592 drivers/net/ethernet/atheros/ag71xx.c 			ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_BE);
ag               1593 drivers/net/ethernet/atheros/ag71xx.c 			netif_err(ag, intr, ndev, "RX BUS error\n");
ag               1598 drivers/net/ethernet/atheros/ag71xx.c 		ag71xx_int_disable(ag, AG71XX_INT_POLL);
ag               1599 drivers/net/ethernet/atheros/ag71xx.c 		netif_dbg(ag, intr, ndev, "enable polling mode\n");
ag               1600 drivers/net/ethernet/atheros/ag71xx.c 		napi_schedule(&ag->napi);
ag               1608 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx *ag = netdev_priv(ndev);
ag               1611 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MAC_MFL,
ag               1640 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx *ag;
ag               1645 drivers/net/ethernet/atheros/ag71xx.c 	ndev = devm_alloc_etherdev(&pdev->dev, sizeof(*ag));
ag               1657 drivers/net/ethernet/atheros/ag71xx.c 	ag = netdev_priv(ndev);
ag               1658 drivers/net/ethernet/atheros/ag71xx.c 	ag->mac_idx = -1;
ag               1661 drivers/net/ethernet/atheros/ag71xx.c 			ag->mac_idx = i;
ag               1664 drivers/net/ethernet/atheros/ag71xx.c 	if (ag->mac_idx < 0) {
ag               1665 drivers/net/ethernet/atheros/ag71xx.c 		netif_err(ag, probe, ndev, "unknown mac idx\n");
ag               1669 drivers/net/ethernet/atheros/ag71xx.c 	ag->clk_eth = devm_clk_get(&pdev->dev, "eth");
ag               1670 drivers/net/ethernet/atheros/ag71xx.c 	if (IS_ERR(ag->clk_eth)) {
ag               1671 drivers/net/ethernet/atheros/ag71xx.c 		netif_err(ag, probe, ndev, "Failed to get eth clk.\n");
ag               1672 drivers/net/ethernet/atheros/ag71xx.c 		return PTR_ERR(ag->clk_eth);
ag               1677 drivers/net/ethernet/atheros/ag71xx.c 	ag->pdev = pdev;
ag               1678 drivers/net/ethernet/atheros/ag71xx.c 	ag->ndev = ndev;
ag               1679 drivers/net/ethernet/atheros/ag71xx.c 	ag->dcfg = dcfg;
ag               1680 drivers/net/ethernet/atheros/ag71xx.c 	ag->msg_enable = netif_msg_init(-1, AG71XX_DEFAULT_MSG_ENABLE);
ag               1681 drivers/net/ethernet/atheros/ag71xx.c 	memcpy(ag->fifodata, dcfg->fifodata, sizeof(ag->fifodata));
ag               1683 drivers/net/ethernet/atheros/ag71xx.c 	ag->mac_reset = devm_reset_control_get(&pdev->dev, "mac");
ag               1684 drivers/net/ethernet/atheros/ag71xx.c 	if (IS_ERR(ag->mac_reset)) {
ag               1685 drivers/net/ethernet/atheros/ag71xx.c 		netif_err(ag, probe, ndev, "missing mac reset\n");
ag               1686 drivers/net/ethernet/atheros/ag71xx.c 		err = PTR_ERR(ag->mac_reset);
ag               1690 drivers/net/ethernet/atheros/ag71xx.c 	ag->mac_base = devm_ioremap_nocache(&pdev->dev, res->start,
ag               1692 drivers/net/ethernet/atheros/ag71xx.c 	if (!ag->mac_base) {
ag               1701 drivers/net/ethernet/atheros/ag71xx.c 		netif_err(ag, probe, ndev, "unable to request IRQ %d\n",
ag               1708 drivers/net/ethernet/atheros/ag71xx.c 	INIT_DELAYED_WORK(&ag->restart_work, ag71xx_restart_work_func);
ag               1709 drivers/net/ethernet/atheros/ag71xx.c 	timer_setup(&ag->oom_timer, ag71xx_oom_timer_handler, 0);
ag               1712 drivers/net/ethernet/atheros/ag71xx.c 	ag->rx_ring.order = ag71xx_ring_size_order(AG71XX_RX_RING_SIZE_DEFAULT);
ag               1717 drivers/net/ethernet/atheros/ag71xx.c 	ag->rx_buf_offset = NET_SKB_PAD;
ag               1718 drivers/net/ethernet/atheros/ag71xx.c 	if (!ag71xx_is(ag, AR7100) && !ag71xx_is(ag, AR9130))
ag               1719 drivers/net/ethernet/atheros/ag71xx.c 		ag->rx_buf_offset += NET_IP_ALIGN;
ag               1721 drivers/net/ethernet/atheros/ag71xx.c 	if (ag71xx_is(ag, AR7100)) {
ag               1722 drivers/net/ethernet/atheros/ag71xx.c 		ag->tx_ring.desc_split = AG71XX_TX_RING_SPLIT;
ag               1725 drivers/net/ethernet/atheros/ag71xx.c 	ag->tx_ring.order = ag71xx_ring_size_order(tx_size);
ag               1727 drivers/net/ethernet/atheros/ag71xx.c 	ag->stop_desc = dmam_alloc_coherent(&pdev->dev,
ag               1729 drivers/net/ethernet/atheros/ag71xx.c 					    &ag->stop_desc_dma, GFP_KERNEL);
ag               1730 drivers/net/ethernet/atheros/ag71xx.c 	if (!ag->stop_desc) {
ag               1735 drivers/net/ethernet/atheros/ag71xx.c 	ag->stop_desc->data = 0;
ag               1736 drivers/net/ethernet/atheros/ag71xx.c 	ag->stop_desc->ctrl = 0;
ag               1737 drivers/net/ethernet/atheros/ag71xx.c 	ag->stop_desc->next = (u32)ag->stop_desc_dma;
ag               1743 drivers/net/ethernet/atheros/ag71xx.c 		netif_err(ag, probe, ndev, "invalid MAC address, using random address\n");
ag               1747 drivers/net/ethernet/atheros/ag71xx.c 	ag->phy_if_mode = of_get_phy_mode(np);
ag               1748 drivers/net/ethernet/atheros/ag71xx.c 	if (ag->phy_if_mode < 0) {
ag               1749 drivers/net/ethernet/atheros/ag71xx.c 		netif_err(ag, probe, ndev, "missing phy-mode property in DT\n");
ag               1750 drivers/net/ethernet/atheros/ag71xx.c 		err = ag->phy_if_mode;
ag               1754 drivers/net/ethernet/atheros/ag71xx.c 	netif_napi_add(ndev, &ag->napi, ag71xx_poll, AG71XX_NAPI_WEIGHT);
ag               1756 drivers/net/ethernet/atheros/ag71xx.c 	err = clk_prepare_enable(ag->clk_eth);
ag               1758 drivers/net/ethernet/atheros/ag71xx.c 		netif_err(ag, probe, ndev, "Failed to enable eth clk.\n");
ag               1762 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, 0);
ag               1764 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_hw_init(ag);
ag               1766 drivers/net/ethernet/atheros/ag71xx.c 	err = ag71xx_mdio_probe(ag);
ag               1774 drivers/net/ethernet/atheros/ag71xx.c 		netif_err(ag, probe, ndev, "unable to register net device\n");
ag               1779 drivers/net/ethernet/atheros/ag71xx.c 	netif_info(ag, probe, ndev, "Atheros AG71xx at 0x%08lx, irq %d, mode:%s\n",
ag               1780 drivers/net/ethernet/atheros/ag71xx.c 		   (unsigned long)ag->mac_base, ndev->irq,
ag               1781 drivers/net/ethernet/atheros/ag71xx.c 		   phy_modes(ag->phy_if_mode));
ag               1786 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_mdio_remove(ag);
ag               1788 drivers/net/ethernet/atheros/ag71xx.c 	clk_disable_unprepare(ag->clk_eth);
ag               1797 drivers/net/ethernet/atheros/ag71xx.c 	struct ag71xx *ag;
ag               1802 drivers/net/ethernet/atheros/ag71xx.c 	ag = netdev_priv(ndev);
ag               1804 drivers/net/ethernet/atheros/ag71xx.c 	ag71xx_mdio_remove(ag);
ag               1805 drivers/net/ethernet/atheros/ag71xx.c 	clk_disable_unprepare(ag->clk_eth);
ag                503 fs/jfs/jfs_extent.c 	int ag;
ag                537 fs/jfs/jfs_extent.c 		ag = BLKTOAG(daddr, sbi);
ag                540 fs/jfs/jfs_extent.c 			atomic_inc(&bmp->db_active[ag]);
ag                541 fs/jfs/jfs_extent.c 			ji->active_ag = ag;
ag                542 fs/jfs/jfs_extent.c 		} else if (ji->active_ag != ag) {
ag                544 fs/jfs/jfs_extent.c 			atomic_inc(&bmp->db_active[ag]);
ag                545 fs/jfs/jfs_extent.c 			ji->active_ag = ag;
ag               1701 fs/jfs/jfs_imap.c 	int ag, rc;
ag               1708 fs/jfs/jfs_imap.c 	for (ag = agno + 1; ag <= maxag; ag++) {
ag               1709 fs/jfs/jfs_imap.c 		AG_LOCK(imap, ag);
ag               1711 fs/jfs/jfs_imap.c 		rc = diAllocAG(imap, ag, dir, ip);
ag               1713 fs/jfs/jfs_imap.c 		AG_UNLOCK(imap, ag);
ag               1721 fs/jfs/jfs_imap.c 	for (ag = 0; ag < agno; ag++) {
ag               1722 fs/jfs/jfs_imap.c 		AG_LOCK(imap, ag);
ag               1724 fs/jfs/jfs_imap.c 		rc = diAllocAG(imap, ag, dir, ip);
ag               1726 fs/jfs/jfs_imap.c 		AG_UNLOCK(imap, ag);
ag               3194 fs/xfs/libxfs/xfs_bmap.c 	xfs_agnumber_t		ag,
ag               3203 fs/xfs/libxfs/xfs_bmap.c 	pag = xfs_perag_get(mp, ag);
ag               3205 fs/xfs/libxfs/xfs_bmap.c 		error = xfs_alloc_pagf_init(mp, tp, ag, XFS_ALLOC_FLAG_TRYLOCK);
ag               3261 fs/xfs/libxfs/xfs_bmap.c 	xfs_agnumber_t		ag, startag;
ag               3268 fs/xfs/libxfs/xfs_bmap.c 	startag = ag = XFS_FSB_TO_AGNO(mp, args->fsbno);
ag               3270 fs/xfs/libxfs/xfs_bmap.c 		startag = ag = 0;
ag               3273 fs/xfs/libxfs/xfs_bmap.c 		error = xfs_bmap_longest_free_extent(args->tp, ag, blen,
ag               3278 fs/xfs/libxfs/xfs_bmap.c 		if (++ag == mp->m_sb.sb_agcount)
ag               3279 fs/xfs/libxfs/xfs_bmap.c 			ag = 0;
ag               3280 fs/xfs/libxfs/xfs_bmap.c 		if (ag == startag)
ag               3295 fs/xfs/libxfs/xfs_bmap.c 	xfs_agnumber_t		ag;
ag               3302 fs/xfs/libxfs/xfs_bmap.c 	ag = XFS_FSB_TO_AGNO(mp, args->fsbno);
ag               3303 fs/xfs/libxfs/xfs_bmap.c 	if (ag == NULLAGNUMBER)
ag               3304 fs/xfs/libxfs/xfs_bmap.c 		ag = 0;
ag               3306 fs/xfs/libxfs/xfs_bmap.c 	error = xfs_bmap_longest_free_extent(args->tp, ag, blen, &notinit);
ag               3311 fs/xfs/libxfs/xfs_bmap.c 		error = xfs_filestream_new_ag(ap, &ag);
ag               3315 fs/xfs/libxfs/xfs_bmap.c 		error = xfs_bmap_longest_free_extent(args->tp, ag, blen,
ag               3328 fs/xfs/libxfs/xfs_bmap.c 	ap->blkno = args->fsbno = XFS_AGB_TO_FSB(mp, ag, 0);
ag               3387 fs/xfs/libxfs/xfs_bmap.c 	xfs_agnumber_t	ag;
ag               3431 fs/xfs/libxfs/xfs_bmap.c 			ag = xfs_filestream_lookup_ag(ap->ip);
ag               3432 fs/xfs/libxfs/xfs_bmap.c 			ag = (ag != NULLAGNUMBER) ? ag : 0;
ag               3433 fs/xfs/libxfs/xfs_bmap.c 			ap->blkno = XFS_AGB_TO_FSB(mp, ag, 0);
ag                 24 fs/xfs/xfs_filestream.c 	xfs_agnumber_t			ag; /* AG in use for this directory */
ag                118 fs/xfs/xfs_filestream.c 	xfs_filestream_put_ag(mp, item->ag);
ag                119 fs/xfs/xfs_filestream.c 	trace_xfs_filestream_free(mp, mru->key, item->ag);
ag                140 fs/xfs/xfs_filestream.c 	xfs_agnumber_t		ag, max_ag = NULLAGNUMBER;
ag                148 fs/xfs/xfs_filestream.c 	ag = startag;
ag                155 fs/xfs/xfs_filestream.c 		trace_xfs_filestream_scan(mp, ip->i_ino, ag);
ag                157 fs/xfs/xfs_filestream.c 		pag = xfs_perag_get(mp, ag);
ag                160 fs/xfs/xfs_filestream.c 			err = xfs_alloc_pagf_init(mp, NULL, ag, trylock);
ag                174 fs/xfs/xfs_filestream.c 			max_ag = ag;
ag                183 fs/xfs/xfs_filestream.c 		if (xfs_filestream_get_ag(mp, ag) > 1) {
ag                184 fs/xfs/xfs_filestream.c 			xfs_filestream_put_ag(mp, ag);
ag                199 fs/xfs/xfs_filestream.c 			*agp = ag;
ag                204 fs/xfs/xfs_filestream.c 		xfs_filestream_put_ag(mp, ag);
ag                208 fs/xfs/xfs_filestream.c 		if (++ag >= mp->m_sb.sb_agcount)
ag                209 fs/xfs/xfs_filestream.c 			ag = 0;
ag                212 fs/xfs/xfs_filestream.c 		if (ag != startag)
ag                254 fs/xfs/xfs_filestream.c 	item->ag = *agp;
ag                308 fs/xfs/xfs_filestream.c 	xfs_agnumber_t		startag, ag = NULLAGNUMBER;
ag                319 fs/xfs/xfs_filestream.c 		ag = container_of(mru, struct xfs_fstrm_item, mru)->ag;
ag                322 fs/xfs/xfs_filestream.c 		trace_xfs_filestream_lookup(mp, ip->i_ino, ag);
ag                338 fs/xfs/xfs_filestream.c 	if (xfs_filestream_pick_ag(pip, startag, &ag, 0, 0))
ag                339 fs/xfs/xfs_filestream.c 		ag = NULLAGNUMBER;
ag                342 fs/xfs/xfs_filestream.c 	return ag;
ag                374 fs/xfs/xfs_filestream.c 		startag = (item->ag + 1) % mp->m_sb.sb_agcount;
ag                963 fs/xfs/xfs_icache.c 	xfs_agnumber_t		ag;
ag                965 fs/xfs/xfs_icache.c 	ag = 0;
ag                966 fs/xfs/xfs_icache.c 	while ((pag = xfs_perag_get(mp, ag))) {
ag                967 fs/xfs/xfs_icache.c 		ag = pag->pag_agno + 1;
ag               1003 fs/xfs/xfs_icache.c 	xfs_agnumber_t		ag;
ag               1005 fs/xfs/xfs_icache.c 	ag = 0;
ag               1006 fs/xfs/xfs_icache.c 	while ((pag = xfs_perag_get_tag(mp, ag, tag))) {
ag               1007 fs/xfs/xfs_icache.c 		ag = pag->pag_agno + 1;
ag               1256 fs/xfs/xfs_icache.c 	xfs_agnumber_t		ag;
ag               1261 fs/xfs/xfs_icache.c 	ag = 0;
ag               1263 fs/xfs/xfs_icache.c 	while ((pag = xfs_perag_get_tag(mp, ag, XFS_ICI_RECLAIM_TAG))) {
ag               1268 fs/xfs/xfs_icache.c 		ag = pag->pag_agno + 1;
ag               1407 fs/xfs/xfs_icache.c 	xfs_agnumber_t		ag = 0;
ag               1410 fs/xfs/xfs_icache.c 	while ((pag = xfs_perag_get_tag(mp, ag, XFS_ICI_RECLAIM_TAG))) {
ag               1411 fs/xfs/xfs_icache.c 		ag = pag->pag_agno + 1;
ag                 27 kernel/sched/autogroup.c 	struct autogroup *ag = container_of(kref, struct autogroup, kref);
ag                 31 kernel/sched/autogroup.c 	ag->tg->rt_se = NULL;
ag                 32 kernel/sched/autogroup.c 	ag->tg->rt_rq = NULL;
ag                 34 kernel/sched/autogroup.c 	sched_offline_group(ag->tg);
ag                 35 kernel/sched/autogroup.c 	sched_destroy_group(ag->tg);
ag                 38 kernel/sched/autogroup.c static inline void autogroup_kref_put(struct autogroup *ag)
ag                 40 kernel/sched/autogroup.c 	kref_put(&ag->kref, autogroup_destroy);
ag                 43 kernel/sched/autogroup.c static inline struct autogroup *autogroup_kref_get(struct autogroup *ag)
ag                 45 kernel/sched/autogroup.c 	kref_get(&ag->kref);
ag                 46 kernel/sched/autogroup.c 	return ag;
ag                 51 kernel/sched/autogroup.c 	struct autogroup *ag;
ag                 57 kernel/sched/autogroup.c 	ag = autogroup_kref_get(p->signal->autogroup);
ag                 60 kernel/sched/autogroup.c 	return ag;
ag                 65 kernel/sched/autogroup.c 	struct autogroup *ag = kzalloc(sizeof(*ag), GFP_KERNEL);
ag                 68 kernel/sched/autogroup.c 	if (!ag)
ag                 75 kernel/sched/autogroup.c 	kref_init(&ag->kref);
ag                 76 kernel/sched/autogroup.c 	init_rwsem(&ag->lock);
ag                 77 kernel/sched/autogroup.c 	ag->id = atomic_inc_return(&autogroup_seq_nr);
ag                 78 kernel/sched/autogroup.c 	ag->tg = tg;
ag                 91 kernel/sched/autogroup.c 	tg->autogroup = ag;
ag                 94 kernel/sched/autogroup.c 	return ag;
ag                 97 kernel/sched/autogroup.c 	kfree(ag);
ag                101 kernel/sched/autogroup.c 			ag ? "sched_create_group()" : "kzalloc()");
ag                136 kernel/sched/autogroup.c autogroup_move_group(struct task_struct *p, struct autogroup *ag)
ag                145 kernel/sched/autogroup.c 	if (prev == ag) {
ag                150 kernel/sched/autogroup.c 	p->signal->autogroup = autogroup_kref_get(ag);
ag                172 kernel/sched/autogroup.c 	struct autogroup *ag = autogroup_create();
ag                174 kernel/sched/autogroup.c 	autogroup_move_group(p, ag);
ag                177 kernel/sched/autogroup.c 	autogroup_kref_put(ag);
ag                211 kernel/sched/autogroup.c 	struct autogroup *ag;
ag                230 kernel/sched/autogroup.c 	ag = autogroup_task_get(p);
ag                235 kernel/sched/autogroup.c 	down_write(&ag->lock);
ag                236 kernel/sched/autogroup.c 	err = sched_group_set_shares(ag->tg, shares);
ag                238 kernel/sched/autogroup.c 		ag->nice = nice;
ag                239 kernel/sched/autogroup.c 	up_write(&ag->lock);
ag                241 kernel/sched/autogroup.c 	autogroup_kref_put(ag);
ag                248 kernel/sched/autogroup.c 	struct autogroup *ag = autogroup_task_get(p);
ag                250 kernel/sched/autogroup.c 	if (!task_group_is_autogroup(ag->tg))
ag                253 kernel/sched/autogroup.c 	down_read(&ag->lock);
ag                254 kernel/sched/autogroup.c 	seq_printf(m, "/autogroup-%ld nice %d\n", ag->id, ag->nice);
ag                255 kernel/sched/autogroup.c 	up_read(&ag->lock);
ag                258 kernel/sched/autogroup.c 	autogroup_kref_put(ag);