config LIQUIDIO
tristate "Cavium LiquidIO support"
+ depends on 64BIT
select PTP_1588_CLOCK
select FW_LOADER
select LIBCRC32
mmiowb();
}
-void lio_cn6xxx_get_pcie_qlmport(struct octeon_device *oct)
+static void lio_cn6xxx_get_pcie_qlmport(struct octeon_device *oct)
{
/* CN63xx Pass2 and newer parts implements the SLI_MAC_NUMBER register
* to determine the PCIE port #
#include <linux/pci.h>
#include <linux/pci_ids.h>
#include <linux/ip.h>
+#include <net/ip.h>
#include <linux/ipv6.h>
#include <linux/net_tstamp.h>
#include <linux/if_vlan.h>
static struct handshake handshake[MAX_OCTEON_DEVICES];
static struct completion first_stage;
-void octeon_droq_bh(unsigned long pdev)
+static void octeon_droq_bh(unsigned long pdev)
{
int q_no;
int reschedule = 0;
tasklet_schedule(&oct_priv->droq_tasklet);
}
-int lio_wait_for_oq_pkts(struct octeon_device *oct)
+static int lio_wait_for_oq_pkts(struct octeon_device *oct)
{
struct octeon_device_priv *oct_priv =
(struct octeon_device_priv *)oct->priv;
* with more to follow; the current offset could be 0 ).
* - ths offset field is non-zero.
*/
- return htons(ip_hdr(skb)->frag_off) & 0x3fff;
+ return (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) ? 1 : 0;
}
static inline int is_ipv6(struct sk_buff *skb)
return 0;
}
-int lio_nic_info(struct octeon_recv_info *recv_info, void *buf)
+static int lio_nic_info(struct octeon_recv_info *recv_info, void *buf)
{
struct octeon_device *oct = (struct octeon_device *)buf;
struct octeon_recv_pkt *recv_pkt = recv_info->recv_pkt;
#define LIO_MAX_IMAGES 16
#define LIO_NIC_MAGIC 0x434E4943 /* "CNIC" */
struct octeon_firmware_desc {
- u64 addr;
- u32 len;
- u32 crc32; /* crc32 of image */
+ __be64 addr;
+ __be32 len;
+ __be32 crc32; /* crc32 of image */
};
/* Following the header is a list of 64-bit aligned binary images,
* Numeric fields are in network byte order.
*/
struct octeon_firmware_file_header {
- u32 magic;
+ __be32 magic;
char version[LIO_MAX_FIRMWARE_VERSION_LEN];
char bootcmd[LIO_MAX_BOOTCMD_LEN];
- u32 num_images;
+ __be32 num_images;
struct octeon_firmware_desc desc[LIO_MAX_IMAGES];
- u32 pad;
- u32 crc32; /* header checksum */
+ __be32 pad;
+ __be32 crc32; /* header checksum */
};
#endif /* _LIQUIDIO_IMAGE_H_ */
#include <linux/crc32.h>
#include <linux/kthread.h>
#include <linux/netdevice.h>
+#include <linux/vmalloc.h>
#include "octeon_config.h"
#include "liquidio_common.h"
#include "octeon_droq.h"
static struct octeon_core_setup core_setup[MAX_OCTEON_DEVICES];
-void oct_set_config_info(int oct_id, int conf_type)
+static void oct_set_config_info(int oct_id, int conf_type)
{
if (conf_type < 0 || conf_type > (NUM_OCTEON_CONFS - 1))
conf_type = OCTEON_CONFIG_TYPE_DEFAULT;
h = (struct octeon_firmware_file_header *)data;
- if (h->magic != be32_to_cpu(LIO_NIC_MAGIC)) {
+ if (be32_to_cpu(h->magic) != LIO_NIC_MAGIC) {
dev_err(&oct->pci_dev->dev, "Unrecognized firmware file.\n");
return -EINVAL;
}
(u32)recv_pkt->rh.r_core_drv_init.app_mode),
sizeof(app_name) - 1);
oct->app_mode = (u32)recv_pkt->rh.r_core_drv_init.app_mode;
- if (recv_pkt->rh.r_core_drv_init.app_mode == CVM_DRV_NIC_APP)
+ if (recv_pkt->rh.r_core_drv_init.app_mode == CVM_DRV_NIC_APP) {
oct->fw_info.max_nic_ports =
(u32)recv_pkt->rh.r_core_drv_init.max_nic_ports;
oct->fw_info.num_gmx_ports =
(u32)recv_pkt->rh.r_core_drv_init.num_gmx_ports;
+ }
if (oct->fw_info.max_nic_ports < num_nic_ports) {
dev_err(&oct->pci_dev->dev,
#include <linux/pci.h>
#include <linux/kthread.h>
#include <linux/netdevice.h>
+#include <linux/vmalloc.h>
#include "octeon_config.h"
#include "liquidio_common.h"
#include "octeon_droq.h"
u64 octeon_read_device_mem64(struct octeon_device *oct, u64 coreaddr)
{
- u64 ret;
+ __be64 ret;
__octeon_pci_rw_core_mem(oct, coreaddr, (u8 *)&ret, 8, 1);
u32 octeon_read_device_mem32(struct octeon_device *oct, u64 coreaddr)
{
- u32 ret;
+ __be32 ret;
__octeon_pci_rw_core_mem(oct, coreaddr, (u8 *)&ret, 4, 1);
void octeon_write_device_mem32(struct octeon_device *oct, u64 coreaddr,
u32 val)
{
- u32 t = cpu_to_be32(val);
+ __be32 t = cpu_to_be32(val);
__octeon_pci_rw_core_mem(oct, coreaddr, (u8 *)&t, 4, 0);
}
#include <linux/pci.h>
#include <linux/kthread.h>
#include <linux/netdevice.h>
+#include <linux/vmalloc.h>
#include "octeon_config.h"
#include "liquidio_common.h"
#include "octeon_droq.h"
if (iq->flush_index != iq->octeon_read_index)
inst_processed = lio_process_iq_request_list(oct, iq);
- if (inst_processed)
+ if (inst_processed) {
atomic_sub(inst_processed, &iq->instr_pending);
iq->stats.instr_processed += inst_processed;
+ }
}
static void