diff -burN tilera_src/pcie/gxpci_host_netdev_ctrl.c 3.14-2-amd64-x86_64/pcie/gxpci_host_netdev_ctrl.c --- tilera_src/pcie/gxpci_host_netdev_ctrl.c 2014-08-28 15:43:14.154607615 +0200 +++ 3.14-2-amd64-x86_64/pcie/gxpci_host_netdev_ctrl.c 2014-08-28 17:26:43.719157450 +0200 @@ -584,13 +584,12 @@ /* PROC read and write routines. */ -static int -tlr_netdev_ctrl_proc_write(struct file *filp, const char __user *buff, - size_t count, void *data) +ssize_t +tlr_netdev_ctrl_proc_write(struct file *filp,const char __user *buf,size_t count,loff_t *data) { char val; - if (copy_from_user(&val, buff, sizeof(char))) + if (copy_from_user(&val, buf, sizeof(char))) return -EFAULT; if (val == 'd' || val == 'D') { @@ -603,15 +602,15 @@ return count; } -static int -tlr_netdev_ctrl_proc_read(char *page, char **start, off_t off, int count, - int *eof, void *data) +ssize_t +tlr_netdev_ctrl_proc_read(struct file *filp,char __user *buf,size_t count,loff_t *offp) { int len; NETDEV_CTRL_TRACE("In netdev_ctrl read.\n"); - len = sprintf(page, "%c\n", proc_value); + + len = sprintf(buf, "%c\n", proc_value); return len; } @@ -621,12 +620,18 @@ { struct proc_dir_entry *entry = NULL; - entry = create_proc_entry("driver/tilegxpci_netdev_ctrl", 0644, NULL); - if (entry) { - entry->data = NULL; - entry->read_proc = tlr_netdev_ctrl_proc_read; - entry->write_proc = tlr_netdev_ctrl_proc_write; - } else { + + struct file_operations proc_fops = { + read: tlr_netdev_ctrl_proc_read, + write: tlr_netdev_ctrl_proc_write + }; + + /* entry->read_proc = tlr_netdev_ctrl_proc_read; + entry->write_proc = tlr_netdev_ctrl_proc_write; */ + + + entry = proc_create("driver/tilegxpci_netdev_ctrl", 0644, NULL,&proc_fops); + if (!entry) { ERR("Failed to create /proc/driver/tilegxpci_netdev_ctrl.\n"); return -EIO; } diff -burN tilera_src/pcie/gxpci_host_nic.c 3.14-2-amd64-x86_64/pcie/gxpci_host_nic.c --- tilera_src/pcie/gxpci_host_nic.c 2014-08-28 15:43:14.166607300 +0200 +++ 3.14-2-amd64-x86_64/pcie/gxpci_host_nic.c 2014-08-28 17:36:04.148384415 +0200 @@ -1906,7 +1906,25 @@ return 0; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0) +/** + * * gxpci_select_queue - Queue select callback. + * **/ +static u16 gxpci_select_queue(struct net_device *netdev, struct sk_buff *skb, void *accel_priv, select_queue_fallback_t fallback) +{ + (void)accel_priv; + (void)fallback; +#define TX_Q_HASH +#ifndef TX_Q_HASH + u16 txq = smp_processor_id(); + while (unlikely(txq >= netdev->real_num_tx_queues)) + txq -= netdev->real_num_tx_queues; + return txq; +#else + return skb_tx_hash(netdev, skb); +#endif +} +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) /** * gxpci_select_queue - Queue select callback. **/ @@ -2359,6 +2377,7 @@ value); spin_unlock(&tlr->lock); + return 0; } #endif @@ -2979,9 +2998,10 @@ #ifdef GXPCI_NETLIB_VNIC netdev->features = NETIF_F_HW_CSUM | - NETIF_F_HW_VLAN_TX | - NETIF_F_HW_VLAN_FILTER; - +//- NETIF_F_HW_VLAN_TX | + NETIF_F_HW_VLAN_CTAG_TX | //+ +//- NETIF_F_HW_VLAN_FILTER; + NETIF_F_HW_VLAN_CTAG_FILTER; //+ err = gxpci_alloc_netlib_regs(nic); if (err) goto err_netlib_regs; @@ -3204,9 +3224,9 @@ * gxpci_host_nic_ip_addr_write - Write handler of proc fs, to accept new IP * for a point-to-point network interface. **/ -static int gxpci_host_nic_ip_addr_write(struct file *filp, +ssize_t gxpci_host_nic_ip_addr_write(struct file *filp, const char __user *buff, - size_t count, void *data) + size_t count, loff_t *data) { struct gxpci_nic *nic = (struct gxpci_nic *)data; struct tlr_pcie_dev *tlr = nic->tlr; @@ -3238,6 +3258,9 @@ struct gxpci_nic *nic; char ifname[IFNAMSIZ]; int err; + struct file_operations proc_fops = { + write: gxpci_host_nic_ip_addr_write + }; if (if_num == 0) sprintf(ifname, "tilep2p%d", tlr->link_index); @@ -3339,11 +3362,8 @@ goto err_register; /* Proc entry for user-specified IP address. */ - entry = create_proc_entry(ifname, S_IRUGO | S_IWUGO, nic_root_entry); - if (entry) { - entry->data = nic; - entry->write_proc = gxpci_host_nic_ip_addr_write; - } else { + entry = proc_create_data(ifname, S_IRUGO | S_IWUGO, nic_root_entry, &proc_fops, nic); + if (!entry) { ERR("Failed to create /proc/%s/%s\n", NIC_ROOT_DIR, ifname); err = -EIO; goto err_proc_entry; diff -burN tilera_src/pcie/packet_queue_common.c 3.14-2-amd64-x86_64/pcie/packet_queue_common.c --- tilera_src/pcie/packet_queue_common.c 2014-08-28 15:43:14.170607195 +0200 +++ 3.14-2-amd64-x86_64/pcie/packet_queue_common.c 2014-08-28 15:47:53.655255447 +0200 @@ -32,6 +32,9 @@ "tile application to start, 10 seconds by default."); extern int pq_numa_capable; +#ifndef VM_RESERVED +# define VM_RESERVED (VM_DONTEXPAND | VM_DONTDUMP) +#endif /**********************************************************************/ /* Packet Queue Support */ diff -burN tilera_src/pcie/raw_dma.c 3.14-2-amd64-x86_64/pcie/raw_dma.c --- tilera_src/pcie/raw_dma.c 2014-08-28 15:43:14.170607195 +0200 +++ 3.14-2-amd64-x86_64/pcie/raw_dma.c 2014-08-28 16:49:23.598154165 +0200 @@ -524,6 +524,9 @@ return -EFAULT; /* Don't try to swap out physical pages. */ + #ifndef VM_RESERVED + # define VM_RESERVED (VM_DONTEXPAND | VM_DONTDUMP) + #endif vma->vm_flags |= VM_RESERVED; vma->vm_ops = &raw_dma_sts_vm_ops; diff -burN tilera_src/pcie/tilegxpci_host.c 3.14-2-amd64-x86_64/pcie/tilegxpci_host.c --- tilera_src/pcie/tilegxpci_host.c 2014-08-28 15:43:14.170607195 +0200 +++ 3.14-2-amd64-x86_64/pcie/tilegxpci_host.c 2014-08-28 17:30:56.868479956 +0200 @@ -4014,10 +4014,17 @@ goto enable_failed; /* Map in the memory-mapped IO registers. */ - tlr->regs = ioremap(pci_resource_start(pci_dev, 0) + - GXPCI_HOST_REGS_OFFSET, - sizeof(struct gxpci_host_regs)); + { + unsigned long paddr = pci_resource_start(pci_dev, 0) + + GXPCI_HOST_REGS_OFFSET; + printk(KERN_WARNING "tile::probe, bar0@%x+%x, paddr@%x, size#%x\n", + (unsigned int)tlr->bar0_address,(unsigned int)paddr-GXPCI_HOST_REGS_OFFSET,(unsigned int)paddr, + (unsigned int)sizeof(struct gxpci_host_regs)); + // ARC_UNCACHED_ADDR_SPACE + tlr->regs = ioremap(paddr, + sizeof(struct gxpci_host_regs)); + } if (tlr->regs == NULL) { dev_err(&pci_dev->dev, "Failed to map gxpci_host_regs regs\n"); @@ -4528,9 +4535,12 @@ INFO("Loaded driver version %s\n", TILEGXPCI_VERSION_STRING); /* /proc file for listing the boards */ - entry = create_proc_entry("driver/tilegxpci_boards", 0, NULL); +//- entry = create_proc_entry("driver/tilegxpci_boards", 0, NULL); + entry = proc_create("driver/tilegxpci_boards", 0, NULL, //+ + &tlr_proc_boards_ops); //+ if (entry) { - entry->proc_fops = &tlr_proc_boards_ops; +//- entry->proc_fops = &tlr_proc_boards_ops; + INFO("/proc/driver/tilegxpci_boards created\n"); } else { ERR("Failed to create /proc/driver/tilegxpci_boards.\n"); diff -burN tilera_src/pcie/tilegxpci_shared_code.c 3.14-2-amd64-x86_64/pcie/tilegxpci_shared_code.c --- tilera_src/pcie/tilegxpci_shared_code.c 2014-08-28 15:43:14.170607195 +0200 +++ 3.14-2-amd64-x86_64/pcie/tilegxpci_shared_code.c 2014-08-28 17:47:23.946475912 +0200 @@ -2037,6 +2037,14 @@ #endif }; + /** 0_0 in ia64_init_addr_space(), VM_RESERVED has been replaced by VM_DONTEXPAND| + VM_DONTDUMP + + in remap_pfn_range(), VM_RESERVED is replaced by VM_DONTEXPAND|VM_DONTDUMP + **/ +#ifndef VM_RESERVED +# define VM_RESERVED (VM_DONTEXPAND | VM_DONTDUMP) +#endif static int tlr_zc_mmap(struct file *filp, struct vm_area_struct *vma) {