linux/drivers/staging/xroeframer/xroe_framer.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0 */
   2/*
   3 * Copyright (C) 2018 Xilinx, Inc.
   4 *
   5 * Vasileios Bimpikas <vasileios.bimpikas@xilinx.com>
   6 */
   7#include "roe_framer_ctrl.h"
   8#include <linux/cdev.h>
   9#include <linux/device.h>
  10#include <linux/errno.h>
  11#include <linux/init.h>
  12#include <linux/interrupt.h>
  13#include <linux/io.h>
  14#include <linux/ioctl.h>
  15#include <linux/kernel.h>
  16#include <linux/kobject.h>
  17#include <linux/module.h>
  18#include <linux/of_address.h>
  19#include <linux/of_device.h>
  20#include <linux/of_platform.h>
  21#include <linux/slab.h>
  22#include <linux/stat.h>
  23#include <linux/string.h>
  24#include <linux/sysfs.h>
  25#include <linux/uaccess.h>
  26#include <uapi/linux/stat.h> /* S_IRUSR, S_IWUSR */
  27
  28/* TODO: Remove hardcoded value of number of Ethernet ports and read the value
  29 * from the device tree.
  30 */
  31#define MAX_NUM_ETH_PORTS 0x4
  32/* TODO: to be made static as well, so that multiple instances can be used. As
  33 * of now, the following 3 structures are shared among the multiple
  34 * source files
  35 */
  36extern struct framer_local *lp;
  37extern struct kobject *root_xroe_kobj;
  38extern struct kobject *kobj_framer;
  39extern struct kobject *kobj_eth_ports[MAX_NUM_ETH_PORTS];
  40struct framer_local {
  41        int irq;
  42        unsigned long mem_start;
  43        unsigned long mem_end;
  44        void __iomem *base_addr;
  45};
  46
  47int xroe_sysfs_init(void);
  48int xroe_sysfs_ipv4_init(void);
  49int xroe_sysfs_ipv6_init(void);
  50int xroe_sysfs_udp_init(void);
  51int xroe_sysfs_stats_init(void);
  52void xroe_sysfs_exit(void);
  53void xroe_sysfs_ipv4_exit(void);
  54void xroe_sysfs_ipv6_exit(void);
  55void xroe_sysfs_udp_exit(void);
  56void xroe_sysfs_stats_exit(void);
  57int utils_write32withmask(void __iomem *working_address, u32 value,
  58                          u32 mask, u32 offset);
  59int utils_check_address_offset(u32 offset, size_t device_size);
  60void utils_sysfs_store_wrapper(u32 address, u32 offset, u32 mask, u32 value,
  61                               struct kobject *kobj);
  62u32 utils_sysfs_show_wrapper(u32 address, u32 offset, u32 mask,
  63                             struct kobject *kobj);
  64