mgp               179 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp;
mgp               368 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static void set_fw_name(struct myri10ge_priv *mgp, char *name, bool allocated)
mgp               370 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->fw_name_allocated)
mgp               371 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		kfree(mgp->fw_name);
mgp               372 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->fw_name = name;
mgp               373 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->fw_name_allocated = allocated;
mgp               377 drivers/net/ethernet/myricom/myri10ge/myri10ge.c myri10ge_send_cmd(struct myri10ge_priv *mgp, u32 cmd,
mgp               382 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct mcp_cmd_response *response = mgp->cmd;
mgp               383 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	char __iomem *cmd_addr = mgp->sram + MXGEFW_ETH_CMD;
mgp               394 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	dma_low = MYRI10GE_LOWPART_TO_U32(mgp->cmd_bus);
mgp               395 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	dma_high = MYRI10GE_HIGHPART_TO_U32(mgp->cmd_bus);
mgp               445 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			dev_err(&mgp->pdev->dev,
mgp               452 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	dev_err(&mgp->pdev->dev, "command %d timed out, result = %d\n",
mgp               464 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static int myri10ge_read_mac_addr(struct myri10ge_priv *mgp)
mgp               469 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	ptr = mgp->eeprom_strings;
mgp               470 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	limit = mgp->eeprom_strings + MYRI10GE_EEPROM_STRINGS_SIZE;
mgp               475 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			mgp->mac_addr_string = ptr;
mgp               479 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				mgp->mac_addr[i] =
mgp               486 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			mgp->product_code_string = ptr;
mgp               490 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			mgp->serial_number = simple_strtoul(ptr, &ptr, 10);
mgp               498 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	dev_err(&mgp->pdev->dev, "failed to parse eeprom_strings\n");
mgp               507 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static void myri10ge_dummy_rdma(struct myri10ge_priv *mgp, int enable)
mgp               515 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->cmd->data = 0;
mgp               522 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	dma_low = MYRI10GE_LOWPART_TO_U32(mgp->cmd_bus);
mgp               523 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	dma_high = MYRI10GE_HIGHPART_TO_U32(mgp->cmd_bus);
mgp               532 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	submit = mgp->sram + MXGEFW_BOOT_DUMMY_RDMA;
mgp               535 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	for (i = 0; mgp->cmd->data != MYRI10GE_NO_CONFIRM_DATA && i < 20; i++)
mgp               537 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->cmd->data != MYRI10GE_NO_CONFIRM_DATA)
mgp               538 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		dev_err(&mgp->pdev->dev, "dummy rdma %s failed\n",
mgp               543 drivers/net/ethernet/myricom/myri10ge/myri10ge.c myri10ge_validate_firmware(struct myri10ge_priv *mgp,
mgp               546 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct device *dev = &mgp->pdev->dev;
mgp               555 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	strncpy(mgp->fw_version, hdr->version, sizeof(mgp->fw_version));
mgp               556 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->fw_version[sizeof(mgp->fw_version) - 1] = '\0';
mgp               558 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	sscanf(mgp->fw_version, "%d.%d.%d", &mgp->fw_ver_major,
mgp               559 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	       &mgp->fw_ver_minor, &mgp->fw_ver_tiny);
mgp               561 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (!(mgp->fw_ver_major == MXGEFW_VERSION_MAJOR &&
mgp               562 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	      mgp->fw_ver_minor == MXGEFW_VERSION_MINOR)) {
mgp               563 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		dev_err(dev, "Found firmware version %s\n", mgp->fw_version);
mgp               571 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static int myri10ge_load_hotplug_firmware(struct myri10ge_priv *mgp, u32 * size)
mgp               575 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct device *dev = &mgp->pdev->dev;
mgp               582 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if ((status = request_firmware(&fw, mgp->fw_name, dev)) < 0) {
mgp               584 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			mgp->fw_name);
mgp               591 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (fw->size >= mgp->sram_size - MYRI10GE_FW_OFFSET ||
mgp               607 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_validate_firmware(mgp, hdr);
mgp               613 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_pio_copy(mgp->sram + MYRI10GE_FW_OFFSET + i,
mgp               617 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		readb(mgp->sram);
mgp               625 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	memcpy_fromio(fw_readback, mgp->sram + MYRI10GE_FW_OFFSET, fw->size);
mgp               643 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static int myri10ge_adopt_running_firmware(struct myri10ge_priv *mgp)
mgp               646 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct device *dev = &mgp->pdev->dev;
mgp               652 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	hdr_offset = swab32(readl(mgp->sram + MCP_HEADER_PTR_OFFSET));
mgp               654 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if ((hdr_offset & 3) || hdr_offset + sizeof(*hdr) > mgp->sram_size) {
mgp               666 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	memcpy_fromio(hdr, mgp->sram + hdr_offset, bytes);
mgp               667 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_validate_firmware(mgp, hdr);
mgp               673 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->fw_ver_major == 1 && mgp->fw_ver_minor == 4 &&
mgp               674 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	    mgp->fw_ver_tiny >= 4 && mgp->fw_ver_tiny <= 11) {
mgp               675 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->adopted_rx_filter_bug = 1;
mgp               678 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			 mgp->fw_ver_major, mgp->fw_ver_minor,
mgp               679 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			 mgp->fw_ver_tiny);
mgp               684 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static int myri10ge_get_firmware_capabilities(struct myri10ge_priv *mgp)
mgp               690 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO;
mgp               691 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_MAX_TSO6_HDR_SIZE,
mgp               694 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->max_tso6 = cmd.data0;
mgp               695 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->features |= NETIF_F_TSO6;
mgp               698 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_RX_RING_SIZE, &cmd, 0);
mgp               700 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		dev_err(&mgp->pdev->dev,
mgp               705 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->max_intr_slots = 2 * (cmd.data0 / sizeof(struct mcp_dma_addr));
mgp               710 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static int myri10ge_load_firmware(struct myri10ge_priv *mgp, int adopt)
mgp               718 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_load_hotplug_firmware(mgp, &size);
mgp               722 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		dev_warn(&mgp->pdev->dev, "hotplug firmware loading failed\n");
mgp               729 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		status = myri10ge_adopt_running_firmware(mgp);
mgp               731 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			dev_err(&mgp->pdev->dev,
mgp               735 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		dev_info(&mgp->pdev->dev,
mgp               737 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		if (mgp->tx_boundary == 4096) {
mgp               738 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			dev_warn(&mgp->pdev->dev,
mgp               741 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			dev_warn(&mgp->pdev->dev,
mgp               744 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			dev_warn(&mgp->pdev->dev, "via hotplug\n");
mgp               747 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		set_fw_name(mgp, "adopted", false);
mgp               748 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->tx_boundary = 2048;
mgp               749 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_dummy_rdma(mgp, 1);
mgp               750 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		status = myri10ge_get_firmware_capabilities(mgp);
mgp               755 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->cmd->data = 0;
mgp               762 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	dma_low = MYRI10GE_LOWPART_TO_U32(mgp->cmd_bus);
mgp               763 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	dma_high = MYRI10GE_HIGHPART_TO_U32(mgp->cmd_bus);
mgp               778 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	submit = mgp->sram + MXGEFW_BOOT_HANDOFF;
mgp               785 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	while (mgp->cmd->data != MYRI10GE_NO_CONFIRM_DATA && i < 9) {
mgp               789 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->cmd->data != MYRI10GE_NO_CONFIRM_DATA) {
mgp               790 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		dev_err(&mgp->pdev->dev, "handoff failed\n");
mgp               793 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_dummy_rdma(mgp, 1);
mgp               794 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_get_firmware_capabilities(mgp);
mgp               799 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static int myri10ge_update_mac_address(struct myri10ge_priv *mgp, u8 * addr)
mgp               809 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, MXGEFW_SET_MAC_ADDRESS, &cmd, 0);
mgp               813 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static int myri10ge_change_pause(struct myri10ge_priv *mgp, int pause)
mgp               819 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, ctl, &cmd, 0);
mgp               822 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		netdev_err(mgp->dev, "Failed to set flow control mode\n");
mgp               825 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->pause = pause;
mgp               830 drivers/net/ethernet/myricom/myri10ge/myri10ge.c myri10ge_change_promisc(struct myri10ge_priv *mgp, int promisc, int atomic)
mgp               836 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, ctl, &cmd, atomic);
mgp               838 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		netdev_err(mgp->dev, "Failed to set promisc mode\n");
mgp               841 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static int myri10ge_dma_test(struct myri10ge_priv *mgp, int test_type)
mgp               853 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	dmatest_bus = pci_map_page(mgp->pdev, dmatest_page, 0, PAGE_SIZE,
mgp               855 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (unlikely(pci_dma_mapping_error(mgp->pdev, dmatest_bus))) {
mgp               869 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	len = mgp->tx_boundary;
mgp               874 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, test_type, &cmd, 0);
mgp               879 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->read_dma = ((cmd.data0 >> 16) * len * 2) / (cmd.data0 & 0xffff);
mgp               883 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, test_type, &cmd, 0);
mgp               888 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->write_dma = ((cmd.data0 >> 16) * len * 2) / (cmd.data0 & 0xffff);
mgp               893 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, test_type, &cmd, 0);
mgp               898 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->read_write_dma = ((cmd.data0 >> 16) * len * 2 * 2) /
mgp               902 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	pci_unmap_page(mgp->pdev, dmatest_bus, PAGE_SIZE, DMA_BIDIRECTIONAL);
mgp               906 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		dev_warn(&mgp->pdev->dev, "DMA %s benchmark failed: %d\n",
mgp               912 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static int myri10ge_reset(struct myri10ge_priv *mgp)
mgp               925 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, MXGEFW_CMD_RESET, &cmd, 0);
mgp               927 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		dev_err(&mgp->pdev->dev, "failed reset\n");
mgp               931 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	(void)myri10ge_dma_test(mgp, MXGEFW_DMA_TEST);
mgp               939 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	(void)myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_RSS_MCP_SLOT_TYPE, &cmd, 0);
mgp               943 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	bytes = mgp->max_intr_slots * sizeof(*mgp->ss[0].rx_done.entry);
mgp               945 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_INTRQ_SIZE, &cmd, 0);
mgp               958 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->num_slices > 1) {
mgp               961 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_MAX_RSS_QUEUES,
mgp               964 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			dev_err(&mgp->pdev->dev,
mgp               973 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		cmd.data0 = mgp->num_slices;
mgp               975 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		if (mgp->dev->real_num_tx_queues > 1)
mgp               977 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		status = myri10ge_send_cmd(mgp, MXGEFW_CMD_ENABLE_RSS_QUEUES,
mgp               983 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		if (status != 0 && mgp->dev->real_num_tx_queues > 1) {
mgp               984 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			netif_set_real_num_tx_queues(mgp->dev, 1);
mgp               985 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			cmd.data0 = mgp->num_slices;
mgp               987 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			status = myri10ge_send_cmd(mgp,
mgp               993 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			dev_err(&mgp->pdev->dev,
mgp               999 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	for (i = 0; i < mgp->num_slices; i++) {
mgp              1000 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		ss = &mgp->ss[i];
mgp              1004 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		status |= myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_INTRQ_DMA,
mgp              1009 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	    myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_IRQ_ACK_OFFSET, &cmd, 0);
mgp              1010 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	for (i = 0; i < mgp->num_slices; i++) {
mgp              1011 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		ss = &mgp->ss[i];
mgp              1013 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		    (__iomem __be32 *) (mgp->sram + cmd.data0 + 8 * i);
mgp              1015 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status |= myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_IRQ_DEASSERT_OFFSET,
mgp              1017 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->irq_deassert = (__iomem __be32 *) (mgp->sram + cmd.data0);
mgp              1020 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	    (mgp, MXGEFW_CMD_GET_INTR_COAL_DELAY_OFFSET, &cmd, 0);
mgp              1021 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->intr_coal_delay_ptr = (__iomem __be32 *) (mgp->sram + cmd.data0);
mgp              1023 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		dev_err(&mgp->pdev->dev, "failed set interrupt parameters\n");
mgp              1026 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	put_be32(htonl(mgp->intr_coal_delay), mgp->intr_coal_delay_ptr);
mgp              1029 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_DCA_OFFSET, &cmd, 0);
mgp              1031 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	for (i = 0; i < mgp->num_slices; i++) {
mgp              1032 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		ss = &mgp->ss[i];
mgp              1035 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			    (mgp->sram + dca_tag_off + 4 * i);
mgp              1044 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->link_changes = 0;
mgp              1045 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	for (i = 0; i < mgp->num_slices; i++) {
mgp              1046 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		ss = &mgp->ss[i];
mgp              1061 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_update_mac_address(mgp, mgp->dev->dev_addr);
mgp              1062 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_change_pause(mgp, mgp->pause);
mgp              1063 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_set_multicast_list(mgp->dev);
mgp              1097 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		tag = dca3_get_tag(&ss->mgp->pdev->dev, cpu);
mgp              1105 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static void myri10ge_setup_dca(struct myri10ge_priv *mgp)
mgp              1108 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct pci_dev *pdev = mgp->pdev;
mgp              1110 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->ss[0].dca_tag == NULL || mgp->dca_enabled)
mgp              1123 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->relaxed_order = myri10ge_toggle_relaxed(pdev, 0);
mgp              1124 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->dca_enabled = 1;
mgp              1125 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	for (i = 0; i < mgp->num_slices; i++) {
mgp              1126 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->ss[i].cpu = -1;
mgp              1127 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->ss[i].cached_dca_tag = -1;
mgp              1128 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_update_dca(&mgp->ss[i]);
mgp              1132 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static void myri10ge_teardown_dca(struct myri10ge_priv *mgp)
mgp              1134 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct pci_dev *pdev = mgp->pdev;
mgp              1136 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (!mgp->dca_enabled)
mgp              1138 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->dca_enabled = 0;
mgp              1139 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->relaxed_order)
mgp              1146 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp;
mgp              1149 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp = dev_get_drvdata(dev);
mgp              1153 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_setup_dca(mgp);
mgp              1155 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_teardown_dca(mgp);
mgp              1190 drivers/net/ethernet/myricom/myri10ge/myri10ge.c myri10ge_alloc_rx_pages(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx,
mgp              1220 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			bus = pci_map_page(mgp->pdev, page, 0,
mgp              1223 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			if (unlikely(pci_dma_mapping_error(mgp->pdev, bus))) {
mgp              1319 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = ss->mgp;
mgp              1324 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct pci_dev *pdev = mgp->pdev;
mgp              1325 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct net_device *dev = mgp->dev;
mgp              1328 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (len <= mgp->small_bytes) {
mgp              1330 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		bytes = mgp->small_bytes;
mgp              1333 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		bytes = mgp->big_bytes;
mgp              1378 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_vlan_rx(mgp->dev, va, skb);
mgp              1379 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	skb_record_rx_queue(skb, ss - &mgp->ss[0]);
mgp              1389 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct pci_dev *pdev = ss->mgp->pdev;
mgp              1426 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	dev_queue = netdev_get_tx_queue(ss->dev, ss - ss->mgp->ss);
mgp              1436 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if ((ss->mgp->dev->real_num_tx_queues > 1) &&
mgp              1449 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	    ss->mgp->running == MYRI10GE_ETH_RUNNING) {
mgp              1459 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = ss->mgp;
mgp              1477 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		idx = cnt & (mgp->max_intr_slots - 1);
mgp              1487 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_alloc_rx_pages(mgp, &ss->rx_small,
mgp              1488 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 					mgp->small_bytes + MXGEFW_PAD, 0);
mgp              1490 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_alloc_rx_pages(mgp, &ss->rx_big, mgp->big_bytes, 0);
mgp              1495 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static inline void myri10ge_check_statblock(struct myri10ge_priv *mgp)
mgp              1497 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct mcp_irq_data *stats = mgp->ss[0].fw_stats;
mgp              1501 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		if (mgp->link_state != link_up) {
mgp              1502 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			mgp->link_state = link_up;
mgp              1504 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			if (mgp->link_state == MXGEFW_LINK_UP) {
mgp              1505 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				netif_info(mgp, link, mgp->dev, "link up\n");
mgp              1506 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				netif_carrier_on(mgp->dev);
mgp              1507 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				mgp->link_changes++;
mgp              1509 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				netif_info(mgp, link, mgp->dev, "link %s\n",
mgp              1513 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				netif_carrier_off(mgp->dev);
mgp              1514 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				mgp->link_changes++;
mgp              1517 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		if (mgp->rdma_tags_available !=
mgp              1519 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			mgp->rdma_tags_available =
mgp              1521 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			netdev_warn(mgp->dev, "RDMA timed out! %d tags left\n",
mgp              1522 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				    mgp->rdma_tags_available);
mgp              1524 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->down_cnt += stats->link_down;
mgp              1526 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			wake_up(&mgp->down_wq);
mgp              1537 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (ss->mgp->dca_enabled)
mgp              1553 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = ss->mgp;
mgp              1561 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if ((mgp->dev->real_num_tx_queues == 1) && (ss != mgp->ss)) {
mgp              1575 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (!mgp->msi_enabled && !mgp->msix_enabled) {
mgp              1576 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		put_be32(0, mgp->irq_deassert);
mgp              1592 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			netdev_warn(mgp->dev, "irq stuck?\n");
mgp              1594 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			schedule_work(&mgp->watchdog_work);
mgp              1603 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (ss == mgp->ss)
mgp              1604 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_check_statblock(mgp);
mgp              1614 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(netdev);
mgp              1628 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	ptr = mgp->product_code_string;
mgp              1637 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				   mgp->product_code_string);
mgp              1658 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(netdev);
mgp              1662 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	strlcpy(info->fw_version, mgp->fw_version, sizeof(info->fw_version));
mgp              1663 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	strlcpy(info->bus_info, pci_name(mgp->pdev), sizeof(info->bus_info));
mgp              1669 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(netdev);
mgp              1671 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	coal->rx_coalesce_usecs = mgp->intr_coal_delay;
mgp              1678 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(netdev);
mgp              1680 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->intr_coal_delay = coal->rx_coalesce_usecs;
mgp              1681 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	put_be32(htonl(mgp->intr_coal_delay), mgp->intr_coal_delay_ptr);
mgp              1689 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(netdev);
mgp              1692 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	pause->rx_pause = mgp->pause;
mgp              1693 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	pause->tx_pause = mgp->pause;
mgp              1700 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(netdev);
mgp              1702 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (pause->tx_pause != mgp->pause)
mgp              1703 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		return myri10ge_change_pause(mgp, pause->tx_pause);
mgp              1704 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (pause->rx_pause != mgp->pause)
mgp              1705 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		return myri10ge_change_pause(mgp, pause->rx_pause);
mgp              1715 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(netdev);
mgp              1717 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	ring->rx_mini_max_pending = mgp->ss[0].rx_small.mask + 1;
mgp              1718 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	ring->rx_max_pending = mgp->ss[0].rx_big.mask + 1;
mgp              1720 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	ring->tx_max_pending = mgp->ss[0].tx.mask + 1;
mgp              1763 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(netdev);
mgp              1771 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		for (i = 0; i < mgp->num_slices; i++) {
mgp              1782 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(netdev);
mgp              1787 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		    mgp->num_slices * MYRI10GE_SLICE_STATS_LEN;
mgp              1797 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(netdev);
mgp              1809 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	data[i++] = (unsigned int)mgp->tx_boundary;
mgp              1810 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	data[i++] = (unsigned int)mgp->pdev->irq;
mgp              1811 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	data[i++] = (unsigned int)mgp->msi_enabled;
mgp              1812 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	data[i++] = (unsigned int)mgp->msix_enabled;
mgp              1813 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	data[i++] = (unsigned int)mgp->read_dma;
mgp              1814 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	data[i++] = (unsigned int)mgp->write_dma;
mgp              1815 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	data[i++] = (unsigned int)mgp->read_write_dma;
mgp              1816 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	data[i++] = (unsigned int)mgp->serial_number;
mgp              1817 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	data[i++] = (unsigned int)mgp->watchdog_resets;
mgp              1819 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	data[i++] = (unsigned int)(mgp->ss[0].dca_tag != NULL);
mgp              1820 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	data[i++] = (unsigned int)(mgp->dca_enabled);
mgp              1822 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	data[i++] = (unsigned int)mgp->link_changes;
mgp              1825 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	ss = &mgp->ss[0];
mgp              1841 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	for (slice = 0; slice < mgp->num_slices; slice++) {
mgp              1842 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		ss = &mgp->ss[slice];
mgp              1858 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(netdev);
mgp              1859 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->msg_enable = value;
mgp              1864 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(netdev);
mgp              1865 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	return mgp->msg_enable;
mgp              1873 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static int myri10ge_led(struct myri10ge_priv *mgp, int on)
mgp              1876 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct device *dev = &mgp->pdev->dev;
mgp              1881 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	hdr_off = swab32(readl(mgp->sram + MCP_HEADER_PTR_OFFSET));
mgp              1882 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if ((hdr_off & 3) || hdr_off + sizeof(*hdr) > mgp->sram_size) {
mgp              1887 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	hdr_len = swab32(readl(mgp->sram + hdr_off +
mgp              1895 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		pattern = swab32(readl(mgp->sram + pattern_off + 4));
mgp              1896 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	writel(swab32(pattern), mgp->sram + pattern_off);
mgp              1903 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(netdev);
mgp              1908 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		rc = myri10ge_led(mgp, 1);
mgp              1912 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		rc =  myri10ge_led(mgp, 0);
mgp              1941 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = ss->mgp;
mgp              1943 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct net_device *dev = mgp->dev;
mgp              1950 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	slice = ss - mgp->ss;
mgp              1952 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_SEND_RING_SIZE, &cmd, 0);
mgp              1955 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status |= myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_RX_RING_SIZE, &cmd, 0);
mgp              2016 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->small_bytes == 0) {
mgp              2019 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_alloc_rx_pages(mgp, &ss->rx_small,
mgp              2020 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 					mgp->small_bytes + MXGEFW_PAD, 0);
mgp              2029 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_alloc_rx_pages(mgp, &ss->rx_big, mgp->big_bytes, 0);
mgp              2041 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_unmap_rx_page(mgp->pdev, &ss->rx_big.info[idx],
mgp              2042 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				       mgp->big_bytes);
mgp              2047 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->small_bytes == 0)
mgp              2051 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_unmap_rx_page(mgp->pdev, &ss->rx_small.info[idx],
mgp              2052 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				       mgp->small_bytes + MXGEFW_PAD);
mgp              2081 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = ss->mgp;
mgp              2094 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_unmap_rx_page(mgp->pdev, &ss->rx_big.info[idx],
mgp              2095 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				       mgp->big_bytes);
mgp              2099 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->small_bytes == 0)
mgp              2106 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_unmap_rx_page(mgp->pdev, &ss->rx_small.info[idx],
mgp              2107 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				       mgp->small_bytes + MXGEFW_PAD);
mgp              2124 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				pci_unmap_single(mgp->pdev,
mgp              2130 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				pci_unmap_page(mgp->pdev,
mgp              2151 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static int myri10ge_request_irq(struct myri10ge_priv *mgp)
mgp              2153 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct pci_dev *pdev = mgp->pdev;
mgp              2155 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct net_device *netdev = mgp->dev;
mgp              2159 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->msi_enabled = 0;
mgp              2160 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->msix_enabled = 0;
mgp              2163 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		if (mgp->num_slices > 1) {
mgp              2164 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			status = pci_enable_msix_range(pdev, mgp->msix_vectors,
mgp              2165 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 					mgp->num_slices, mgp->num_slices);
mgp              2171 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			mgp->msix_enabled = 1;
mgp              2173 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		if (mgp->msix_enabled == 0) {
mgp              2180 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				mgp->msi_enabled = 1;
mgp              2184 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->msix_enabled) {
mgp              2185 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		for (i = 0; i < mgp->num_slices; i++) {
mgp              2186 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			ss = &mgp->ss[i];
mgp              2189 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			status = request_irq(mgp->msix_vectors[i].vector,
mgp              2197 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 					free_irq(mgp->msix_vectors[i].vector,
mgp              2198 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 						 &mgp->ss[i]);
mgp              2207 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				     mgp->dev->name, &mgp->ss[0]);
mgp              2210 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			if (mgp->msi_enabled)
mgp              2217 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static void myri10ge_free_irq(struct myri10ge_priv *mgp)
mgp              2219 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct pci_dev *pdev = mgp->pdev;
mgp              2222 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->msix_enabled) {
mgp              2223 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		for (i = 0; i < mgp->num_slices; i++)
mgp              2224 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			free_irq(mgp->msix_vectors[i].vector, &mgp->ss[i]);
mgp              2226 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		free_irq(pdev->irq, &mgp->ss[0]);
mgp              2228 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->msi_enabled)
mgp              2230 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->msix_enabled)
mgp              2234 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static int myri10ge_get_txrx(struct myri10ge_priv *mgp, int slice)
mgp              2240 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	ss = &mgp->ss[slice];
mgp              2242 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (slice == 0 || (mgp->dev->real_num_tx_queues > 1)) {
mgp              2244 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_SEND_OFFSET,
mgp              2247 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		    (mgp->sram + cmd.data0);
mgp              2250 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status |= myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_SMALL_RX_OFFSET,
mgp              2253 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	    (mgp->sram + cmd.data0);
mgp              2256 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status |= myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_BIG_RX_OFFSET, &cmd, 0);
mgp              2258 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	    (mgp->sram + cmd.data0);
mgp              2261 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	    (mgp->sram + MXGEFW_ETH_SEND_GO + 64 * slice);
mgp              2263 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	    (mgp->sram + MXGEFW_ETH_SEND_STOP + 64 * slice);
mgp              2268 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static int myri10ge_set_stats(struct myri10ge_priv *mgp, int slice)
mgp              2274 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	ss = &mgp->ss[slice];
mgp              2278 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_STATS_DMA_V2, &cmd, 0);
mgp              2286 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		status = myri10ge_send_cmd(mgp,
mgp              2290 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->fw_multicast_support = 0;
mgp              2292 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->fw_multicast_support = 1;
mgp              2300 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(dev);
mgp              2305 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->running != MYRI10GE_ETH_STOPPED)
mgp              2308 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->running = MYRI10GE_ETH_STARTING;
mgp              2309 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_reset(mgp);
mgp              2315 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->num_slices > 1) {
mgp              2316 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		cmd.data0 = mgp->num_slices;
mgp              2318 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		if (mgp->dev->real_num_tx_queues > 1)
mgp              2320 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		status = myri10ge_send_cmd(mgp, MXGEFW_CMD_ENABLE_RSS_QUEUES,
mgp              2327 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		cmd.data0 = mgp->num_slices;
mgp              2328 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		status = myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_RSS_TABLE_SIZE,
mgp              2331 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		status |= myri10ge_send_cmd(mgp,
mgp              2340 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		itable = mgp->sram + cmd.data0;
mgp              2341 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		for (i = 0; i < mgp->num_slices; i++)
mgp              2346 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		status = myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_RSS_ENABLE,
mgp              2354 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_request_irq(mgp);
mgp              2366 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->small_bytes = (128 > SMP_CACHE_BYTES)
mgp              2371 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->small_bytes = VLAN_ETH_FRAME_LEN;
mgp              2375 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->small_bytes = myri10ge_small_bytes;
mgp              2385 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->big_bytes = dev->mtu + ETH_HLEN + VLAN_HLEN + MXGEFW_PAD;
mgp              2388 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->big_bytes = big_pow2;
mgp              2392 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	for (slice = 0; slice < mgp->num_slices; slice++) {
mgp              2393 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		ss = &mgp->ss[slice];
mgp              2395 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		status = myri10ge_get_txrx(mgp, slice);
mgp              2407 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		if (slice == 0 || mgp->dev->real_num_tx_queues > 1)
mgp              2408 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			status = myri10ge_set_stats(mgp, slice);
mgp              2420 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_MTU, &cmd, 0);
mgp              2421 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	cmd.data0 = mgp->small_bytes;
mgp              2423 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	    myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_SMALL_BUFFER_SIZE, &cmd, 0);
mgp              2426 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	    myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_BIG_BUFFER_SIZE, &cmd, 0);
mgp              2438 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_TSO_MODE, &cmd, 0);
mgp              2444 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->link_state = ~0U;
mgp              2445 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->rdma_tags_available = 15;
mgp              2447 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, MXGEFW_CMD_ETHERNET_UP, &cmd, 0);
mgp              2453 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->running = MYRI10GE_ETH_RUNNING;
mgp              2454 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->watchdog_timer.expires = jiffies + myri10ge_watchdog_timeout * HZ;
mgp              2455 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	add_timer(&mgp->watchdog_timer);
mgp              2463 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		napi_disable(&mgp->ss[slice].napi);
mgp              2465 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	for (i = 0; i < mgp->num_slices; i++)
mgp              2466 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_free_rings(&mgp->ss[i]);
mgp              2468 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_free_irq(mgp);
mgp              2471 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->running = MYRI10GE_ETH_STOPPED;
mgp              2477 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(dev);
mgp              2482 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->running != MYRI10GE_ETH_RUNNING)
mgp              2485 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->ss[0].tx.req_bytes == NULL)
mgp              2488 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	del_timer_sync(&mgp->watchdog_timer);
mgp              2489 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->running = MYRI10GE_ETH_STOPPING;
mgp              2490 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	for (i = 0; i < mgp->num_slices; i++)
mgp              2491 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		napi_disable(&mgp->ss[i].napi);
mgp              2496 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->rebooted == 0) {
mgp              2497 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		old_down_cnt = mgp->down_cnt;
mgp              2500 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		    myri10ge_send_cmd(mgp, MXGEFW_CMD_ETHERNET_DOWN, &cmd, 0);
mgp              2504 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		wait_event_timeout(mgp->down_wq, old_down_cnt != mgp->down_cnt,
mgp              2506 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		if (old_down_cnt == mgp->down_cnt)
mgp              2510 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_free_irq(mgp);
mgp              2511 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	for (i = 0; i < mgp->num_slices; i++)
mgp              2512 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_free_rings(&mgp->ss[i]);
mgp              2514 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->running = MYRI10GE_ETH_STOPPED;
mgp              2585 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static void myri10ge_unmap_tx_dma(struct myri10ge_priv *mgp,
mgp              2598 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				pci_unmap_single(mgp->pdev,
mgp              2603 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				pci_unmap_page(mgp->pdev,
mgp              2627 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(dev);
mgp              2643 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	ss = &mgp->ss[queue];
mgp              2644 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	netdev_queue = netdev_get_tx_queue(mgp->dev, queue);
mgp              2706 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			if (unlikely(-cum_len > mgp->max_tso6))
mgp              2729 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	bus = pci_map_single(mgp->pdev, skb->data, len, PCI_DMA_TODEVICE);
mgp              2730 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (unlikely(pci_dma_mapping_error(mgp->pdev, bus)))
mgp              2774 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			    (low + mgp->tx_boundary) & ~(mgp->tx_boundary - 1);
mgp              2836 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		bus = skb_frag_dma_map(&mgp->pdev->dev, frag, 0, len,
mgp              2838 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		if (unlikely(pci_dma_mapping_error(mgp->pdev, bus))) {
mgp              2839 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			myri10ge_unmap_tx_dma(mgp, tx, idx);
mgp              2859 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if ((mgp->dev->real_num_tx_queues > 1) && tx->queue_active == 0) {
mgp              2872 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_unmap_tx_dma(mgp, tx, idx);
mgp              2875 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		netdev_err(mgp->dev, "TSO but wanted to linearize?!?!?\n");
mgp              2896 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(dev);
mgp              2924 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	ss = &mgp->ss[skb_get_queue_mapping(skb)];
mgp              2933 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	const struct myri10ge_priv *mgp = netdev_priv(dev);
mgp              2937 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	for (i = 0; i < mgp->num_slices; i++) {
mgp              2938 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		slice_stats = &mgp->ss[i].stats;
mgp              2950 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(dev);
mgp              2958 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_change_promisc(mgp, dev->flags & IFF_PROMISC, 1);
mgp              2961 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (!mgp->fw_multicast_support)
mgp              2966 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	err = myri10ge_send_cmd(mgp, MXGEFW_ENABLE_ALLMULTI, &cmd, 1);
mgp              2973 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if ((dev->flags & IFF_ALLMULTI) || mgp->adopted_rx_filter_bug) {
mgp              2980 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	err = myri10ge_send_cmd(mgp, MXGEFW_LEAVE_ALL_MULTICAST_GROUPS,
mgp              2993 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		err = myri10ge_send_cmd(mgp, MXGEFW_JOIN_MULTICAST_GROUP,
mgp              3003 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	err = myri10ge_send_cmd(mgp, MXGEFW_DISABLE_ALLMULTI, &cmd, 1);
mgp              3019 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(dev);
mgp              3025 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_update_mac_address(mgp, sa->sa_data);
mgp              3039 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = netdev_priv(dev);
mgp              3042 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->running) {
mgp              3060 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static void myri10ge_enable_ecrc(struct myri10ge_priv *mgp)
mgp              3062 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct pci_dev *bridge = mgp->pdev->bus->self;
mgp              3063 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct device *dev = &mgp->pdev->dev;
mgp              3141 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static void myri10ge_firmware_probe(struct myri10ge_priv *mgp)
mgp              3143 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct pci_dev *pdev = mgp->pdev;
mgp              3147 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->tx_boundary = 4096;
mgp              3159 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->tx_boundary = 2048;
mgp              3165 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	set_fw_name(mgp, myri10ge_fw_aligned, false);
mgp              3166 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_load_firmware(mgp, 1);
mgp              3174 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_enable_ecrc(mgp);
mgp              3181 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_dma_test(mgp, MXGEFW_CMD_UNALIGNED_TEST);
mgp              3192 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->tx_boundary = 2048;
mgp              3193 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	set_fw_name(mgp, myri10ge_fw_unaligned, false);
mgp              3196 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static void myri10ge_select_firmware(struct myri10ge_priv *mgp)
mgp              3204 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		pcie_capability_read_word(mgp->pdev, PCI_EXP_LNKSTA, &lnk);
mgp              3211 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			dev_info(&mgp->pdev->dev, "PCIE x%d Link\n",
mgp              3213 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			mgp->tx_boundary = 4096;
mgp              3214 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			set_fw_name(mgp, myri10ge_fw_aligned, false);
mgp              3216 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			myri10ge_firmware_probe(mgp);
mgp              3220 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			dev_info(&mgp->pdev->dev,
mgp              3222 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			mgp->tx_boundary = 4096;
mgp              3223 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			set_fw_name(mgp, myri10ge_fw_aligned, false);
mgp              3225 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			dev_info(&mgp->pdev->dev,
mgp              3227 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			mgp->tx_boundary = 2048;
mgp              3228 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			set_fw_name(mgp, myri10ge_fw_unaligned, false);
mgp              3237 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			set_fw_name(mgp, fw_name, true);
mgp              3242 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->board_number < MYRI10GE_MAX_BOARDS &&
mgp              3243 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	    myri10ge_fw_names[mgp->board_number] != NULL &&
mgp              3244 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	    strlen(myri10ge_fw_names[mgp->board_number])) {
mgp              3245 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		set_fw_name(mgp, myri10ge_fw_names[mgp->board_number], false);
mgp              3249 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		dev_info(&mgp->pdev->dev, "overriding firmware to %s\n",
mgp              3250 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			 mgp->fw_name);
mgp              3276 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp;
mgp              3279 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp = pci_get_drvdata(pdev);
mgp              3280 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp == NULL)
mgp              3282 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	netdev = mgp->dev;
mgp              3291 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_dummy_rdma(mgp, 0);
mgp              3300 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp;
mgp              3305 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp = pci_get_drvdata(pdev);
mgp              3306 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp == NULL)
mgp              3308 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	netdev = mgp->dev;
mgp              3311 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	pci_read_config_word(mgp->pdev, PCI_VENDOR_ID, &vendor);
mgp              3313 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		netdev_err(mgp->dev, "device disappeared!\n");
mgp              3327 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_reset(mgp);
mgp              3328 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_dummy_rdma(mgp, 1);
mgp              3353 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static u32 myri10ge_read_reboot(struct myri10ge_priv *mgp)
mgp              3355 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct pci_dev *pdev = mgp->pdev;
mgp              3356 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	int vs = mgp->vendor_specific_offset;
mgp              3372 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp = ss->mgp;
mgp              3373 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	int slice = ss - mgp->ss;
mgp              3379 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		if (rx_pause_cnt != mgp->watchdog_pause) {
mgp              3381 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				netdev_warn(mgp->dev, "slice %d: TX paused, "
mgp              3384 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			netdev_warn(mgp->dev,
mgp              3389 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				    (int)ntohl(mgp->ss[slice].fw_stats->
mgp              3410 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp =
mgp              3420 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->watchdog_resets++;
mgp              3421 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	pci_read_config_word(mgp->pdev, PCI_COMMAND, &cmd);
mgp              3427 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		reboot = myri10ge_read_reboot(mgp);
mgp              3428 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		netdev_err(mgp->dev, "NIC rebooted (0x%x),%s resetting\n",
mgp              3433 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->rebooted = 1;
mgp              3435 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_close(mgp->dev);
mgp              3437 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->rebooted = 0;
mgp              3445 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		pci_restore_state(mgp->pdev);
mgp              3448 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		pci_save_state(mgp->pdev);
mgp              3455 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			pci_read_config_word(mgp->pdev, PCI_VENDOR_ID, &vendor);
mgp              3457 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				netdev_err(mgp->dev, "device disappeared!\n");
mgp              3463 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		rx_pause_cnt = ntohl(mgp->ss[0].fw_stats->dropped_pause);
mgp              3464 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		for (i = 0; i < mgp->num_slices; i++) {
mgp              3465 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			ss = mgp->ss;
mgp              3474 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			netdev_dbg(mgp->dev, "not resetting\n");
mgp              3478 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		netdev_err(mgp->dev, "device timeout, resetting\n");
mgp              3483 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_close(mgp->dev);
mgp              3485 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_load_firmware(mgp, 1);
mgp              3487 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		netdev_err(mgp->dev, "failed to load firmware\n");
mgp              3489 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		myri10ge_open(mgp->dev);
mgp              3502 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp;
mgp              3508 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp = from_timer(mgp, t, watchdog_timer);
mgp              3510 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	rx_pause_cnt = ntohl(mgp->ss[0].fw_stats->dropped_pause);
mgp              3513 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	     i < mgp->num_slices && reset_needed == 0; ++i) {
mgp              3515 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		ss = &mgp->ss[i];
mgp              3517 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			myri10ge_alloc_rx_pages(mgp, &ss->rx_small,
mgp              3518 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 						mgp->small_bytes + MXGEFW_PAD,
mgp              3525 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			myri10ge_alloc_rx_pages(mgp, &ss->rx_big,
mgp              3526 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 						mgp->big_bytes, 1);
mgp              3538 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		pci_read_config_word(mgp->pdev, PCI_COMMAND, &cmd);
mgp              3543 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->watchdog_pause = rx_pause_cnt;
mgp              3546 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		schedule_work(&mgp->watchdog_work);
mgp              3549 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mod_timer(&mgp->watchdog_timer,
mgp              3554 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static void myri10ge_free_slices(struct myri10ge_priv *mgp)
mgp              3557 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct pci_dev *pdev = mgp->pdev;
mgp              3561 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->ss == NULL)
mgp              3564 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	for (i = 0; i < mgp->num_slices; i++) {
mgp              3565 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		ss = &mgp->ss[i];
mgp              3567 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			bytes = mgp->max_intr_slots *
mgp              3584 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	kfree(mgp->ss);
mgp              3585 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->ss = NULL;
mgp              3588 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static int myri10ge_alloc_slices(struct myri10ge_priv *mgp)
mgp              3591 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct pci_dev *pdev = mgp->pdev;
mgp              3595 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	bytes = sizeof(*mgp->ss) * mgp->num_slices;
mgp              3596 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->ss = kzalloc(bytes, GFP_KERNEL);
mgp              3597 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->ss == NULL) {
mgp              3601 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	for (i = 0; i < mgp->num_slices; i++) {
mgp              3602 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		ss = &mgp->ss[i];
mgp              3603 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		bytes = mgp->max_intr_slots * sizeof(*ss->rx_done.entry);
mgp              3615 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		ss->mgp = mgp;
mgp              3616 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		ss->dev = mgp->dev;
mgp              3622 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_free_slices(mgp);
mgp              3632 drivers/net/ethernet/myricom/myri10ge/myri10ge.c static void myri10ge_probe_slices(struct myri10ge_priv *mgp)
mgp              3635 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct pci_dev *pdev = mgp->pdev;
mgp              3640 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->num_slices = 1;
mgp              3648 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	old_fw = mgp->fw_name;
mgp              3649 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	old_allocated = mgp->fw_name_allocated;
mgp              3651 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->fw_name_allocated = false;
mgp              3654 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		dev_info(&mgp->pdev->dev, "overriding rss firmware to %s\n",
mgp              3656 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		set_fw_name(mgp, myri10ge_fw_name, false);
mgp              3658 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		set_fw_name(mgp, myri10ge_fw_rss_aligned, false);
mgp              3660 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		set_fw_name(mgp, myri10ge_fw_rss_unaligned, false);
mgp              3661 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_load_firmware(mgp, 0);
mgp              3671 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, MXGEFW_CMD_RESET, &cmd, 0);
mgp              3673 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		dev_err(&mgp->pdev->dev, "failed reset\n");
mgp              3677 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->max_intr_slots = cmd.data0 / sizeof(struct mcp_slot);
mgp              3680 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	cmd.data0 = mgp->max_intr_slots * sizeof(struct mcp_slot);
mgp              3681 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, MXGEFW_CMD_SET_INTRQ_SIZE, &cmd, 0);
mgp              3683 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		dev_err(&mgp->pdev->dev, "failed MXGEFW_CMD_SET_INTRQ_SIZE\n");
mgp              3688 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_MAX_RSS_QUEUES, &cmd, 0);
mgp              3692 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->num_slices = cmd.data0;
mgp              3705 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->num_slices > myri10ge_max_slices)
mgp              3706 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->num_slices = myri10ge_max_slices;
mgp              3712 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->msix_vectors = kcalloc(mgp->num_slices, sizeof(*mgp->msix_vectors),
mgp              3714 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->msix_vectors == NULL)
mgp              3716 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	for (i = 0; i < mgp->num_slices; i++) {
mgp              3717 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->msix_vectors[i].entry = i;
mgp              3720 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	while (mgp->num_slices > 1) {
mgp              3721 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->num_slices = rounddown_pow_of_two(mgp->num_slices);
mgp              3722 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		if (mgp->num_slices == 1)
mgp              3725 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 					       mgp->msix_vectors,
mgp              3726 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 					       mgp->num_slices,
mgp              3727 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 					       mgp->num_slices);
mgp              3733 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		if (status == mgp->num_slices) {
mgp              3738 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			mgp->num_slices = status;
mgp              3743 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->msix_vectors != NULL) {
mgp              3744 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		kfree(mgp->msix_vectors);
mgp              3745 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		mgp->msix_vectors = NULL;
mgp              3749 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->num_slices = 1;
mgp              3750 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	set_fw_name(mgp, old_fw, old_allocated);
mgp              3751 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_load_firmware(mgp, 0);
mgp              3768 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp;
mgp              3776 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	netdev = alloc_etherdev_mq(sizeof(*mgp), MYRI10GE_MAX_SLICES);
mgp              3782 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp = netdev_priv(netdev);
mgp              3783 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->dev = netdev;
mgp              3784 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->pdev = pdev;
mgp              3785 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->pause = myri10ge_flow_control;
mgp              3786 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->intr_coal_delay = myri10ge_intr_coal_delay;
mgp              3787 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->msg_enable = netif_msg_init(myri10ge_debug, MYRI10GE_MSG_DEFAULT);
mgp              3788 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->board_number = board_number;
mgp              3789 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	init_waitqueue_head(&mgp->down_wq);
mgp              3799 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->vendor_specific_offset
mgp              3826 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd),
mgp              3827 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 				      &mgp->cmd_bus, GFP_KERNEL);
mgp              3828 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (!mgp->cmd) {
mgp              3833 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->board_span = pci_resource_len(pdev, 0);
mgp              3834 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->iomem_base = pci_resource_start(pdev, 0);
mgp              3835 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->wc_cookie = arch_phys_wc_add(mgp->iomem_base, mgp->board_span);
mgp              3836 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->sram = ioremap_wc(mgp->iomem_base, mgp->board_span);
mgp              3837 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->sram == NULL) {
mgp              3839 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			mgp->board_span, mgp->iomem_base);
mgp              3844 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	    swab32(readl(mgp->sram + MCP_HEADER_PTR_OFFSET)) & 0xffffc;
mgp              3846 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp->sram_size = swab32(readl(mgp->sram + ss_offset));
mgp              3847 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->sram_size > mgp->board_span ||
mgp              3848 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	    mgp->sram_size <= MYRI10GE_FW_OFFSET) {
mgp              3851 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			mgp->sram_size, mgp->board_span);
mgp              3854 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	memcpy_fromio(mgp->eeprom_strings,
mgp              3855 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		      mgp->sram + mgp->sram_size, MYRI10GE_EEPROM_STRINGS_SIZE);
mgp              3856 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	memset(mgp->eeprom_strings + MYRI10GE_EEPROM_STRINGS_SIZE - 2, 0, 2);
mgp              3857 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_read_mac_addr(mgp);
mgp              3862 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 		netdev->dev_addr[i] = mgp->mac_addr[i];
mgp              3864 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_select_firmware(mgp);
mgp              3866 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_load_firmware(mgp, 1);
mgp              3871 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_probe_slices(mgp);
mgp              3872 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_alloc_slices(mgp);
mgp              3877 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	netif_set_real_num_tx_queues(netdev, mgp->num_slices);
mgp              3878 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	netif_set_real_num_rx_queues(netdev, mgp->num_slices);
mgp              3879 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_reset(mgp);
mgp              3885 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_setup_dca(mgp);
mgp              3887 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	pci_set_drvdata(pdev, mgp);
mgp              3901 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	netdev->hw_features = mgp->features | NETIF_F_RXCSUM;
mgp              3911 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	netdev->vlan_features |= mgp->features;
mgp              3912 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->fw_ver_tiny < 37)
mgp              3914 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->fw_ver_tiny < 32)
mgp              3919 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	status = myri10ge_request_irq(mgp);
mgp              3922 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_free_irq(mgp);
mgp              3929 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	timer_setup(&mgp->watchdog_timer, myri10ge_watchdog_timer, 0);
mgp              3932 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	INIT_WORK(&mgp->watchdog_work, myri10ge_watchdog);
mgp              3938 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->msix_enabled)
mgp              3940 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			 mgp->num_slices, mgp->tx_boundary, mgp->fw_name,
mgp              3941 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			 (mgp->wc_cookie > 0 ? "Enabled" : "Disabled"));
mgp              3944 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			 mgp->msi_enabled ? "MSI" : "xPIC",
mgp              3945 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			 pdev->irq, mgp->tx_boundary, mgp->fw_name,
mgp              3946 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			 (mgp->wc_cookie > 0 ? "Enabled" : "Disabled"));
mgp              3955 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_free_slices(mgp);
mgp              3958 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_dummy_rdma(mgp, 0);
mgp              3961 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp->mac_addr_string != NULL)
mgp              3964 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			mgp->mac_addr_string, mgp->serial_number);
mgp              3965 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	iounmap(mgp->sram);
mgp              3968 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	arch_phys_wc_del(mgp->wc_cookie);
mgp              3969 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	dma_free_coherent(&pdev->dev, sizeof(*mgp->cmd),
mgp              3970 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			  mgp->cmd, mgp->cmd_bus);
mgp              3976 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	set_fw_name(mgp, NULL, false);
mgp              3990 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	struct myri10ge_priv *mgp;
mgp              3993 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	mgp = pci_get_drvdata(pdev);
mgp              3994 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	if (mgp == NULL)
mgp              3997 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	cancel_work_sync(&mgp->watchdog_work);
mgp              3998 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	netdev = mgp->dev;
mgp              4002 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_teardown_dca(mgp);
mgp              4004 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_dummy_rdma(mgp, 0);
mgp              4009 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	iounmap(mgp->sram);
mgp              4010 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	arch_phys_wc_del(mgp->wc_cookie);
mgp              4011 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	myri10ge_free_slices(mgp);
mgp              4012 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	kfree(mgp->msix_vectors);
mgp              4013 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	dma_free_coherent(&pdev->dev, sizeof(*mgp->cmd),
mgp              4014 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 			  mgp->cmd, mgp->cmd_bus);
mgp              4016 drivers/net/ethernet/myricom/myri10ge/myri10ge.c 	set_fw_name(mgp, NULL, false);
mgp              2534 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c 	int hip, mgp, bkp, bep, vip, vop;
mgp              2558 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c 		mgp = 0;
mgp              2588 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c 		mgp = 0;
mgp              2603 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c 		mgp = mgq ^ 3;
mgp              2639 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c 			usb_sndbulkpipe(priv->udev, priv->out_ep[mgp]);