This module also supports the sram partitioning scheme. SRAM partition definitions are defined in axis_sram.c and are fixed at compile time. Note at the momemt the MTS system fails if more than one device is defined by the axis driver and the driver attempts to unload
#include "axis_sram.h"
#include <linux/mtd/partitions.h>
Include dependency graph for axis_sram.c:

Functions | |
| void | update_sram_access (struct sram_block *block) |
| int | set_block_read (struct sram_block *block, int allow) |
| int | set_block_write (struct sram_block *block, int allow) |
| int | set_block_read_write (struct sram_block *block, int read_allow, int write_allow) |
| int | mtd_ram_erase (struct mtd_info *mtd, struct erase_info *instr) |
| Function to simulate erasing flash for MTD subsystem. | |
| int | mtd_ram_point (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char **mtdbuf) |
| passed to MTD system | |
| void | mtd_ram_unpoint (struct mtd_info *mtd, u_char *addr, loff_t from, size_t len) |
| passed to MTD system | |
| int | mtd_ram_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buffer) |
| Ram read for MTD sub system. | |
| int | mtd_ram_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buffer) |
| Rather than messing about with the SRAM let the Linux MTD support handle it. | |
| int | axis_ram_open (struct inode *inode_ptr,struct file *file_ptr) |
| open function for sram partition character support | |
| loff_t | axis_ram_llseek (struct file *file_ptr, loff_t offset, int where_from) |
| handles user lseek calls for SRAM devices. | |
| ssize_t | axis_ram_read (struct file *file_ptr, char *buf, size_t count, loff_t *ppos) |
| Gets data from a SRAM partition and returns it to userland. | |
| ssize_t | axis_ram_write (struct file *file_ptr, const char *buf, size_t count, loff_t *ppos) |
| Copies data from USER space and sends it to SRAM. | |
| int | axis_ram_ioctl (struct inode *inode_ptr, struct file *file_ptr, unsigned int type, unsigned long data) |
| Provides an interface to allow user land to control sram read/write. | |
| int | axis_ram_mmap (struct file *file_ptr, struct vm_area_struct *vma) |
| handles a user mmap request. | |
| int | axis_ram_release (struct inode *inode_ptr, struct file *file_ptr) |
| Called by kernel in response to a process closing a device. | |
| int | proc_read_sram (char *buf, char **start, off_t offset, int count, int *eof, void *data) |
| Outputs data about the current SRAM configuration. | |
| int | proc_read_mtd_config (char *buf, char **start, off_t offset, int count, int *eof, void *data) |
| int | proc_read_read_enable (char *buf, char **start, off_t offset, int count, int *eof, void *data) |
| int | proc_read_write_enable (char *buf, char **start, off_t offset, int count, int *eof, void *data) |
| int | proc_write_read_enable (struct file *file, const char *buffer, unsigned long count, void *data) |
| int | proc_write_write_enable (struct file *file, const char *buffer, unsigned long count, void *data) |
| unsigned long | index_to_read_map (unsigned long i) |
| unsigned long | index_to_write_map (unsigned long i) |
| void | init_access_control_entry (struct access_control_entry *ptr, unsigned long start_address, ssize_t length, int write_not_read) |
| void | init_sram_access_control (struct sram_access_control *ptr, unsigned long start_address, ssize_t length) |
| void | create_proc_sram_directory (struct axis_pci_device_entry *device, struct sram_block *block) |
| void | delete_proc_sram_directory (struct axis_pci_device_entry *device, struct sram_block *block) |
| void | create_proc_sram_entries (struct axis_pci_device_entry *device) |
| Creates a /proc directory fills it entries that output the current SRAM configuration. | |
| void | delete_proc_sram_entries (struct axis_pci_device_entry *device) |
| Deletes the SRAM related entries in the /Proc filesystem. | |
| void | init_mtd_block (struct mtd_info *block, ssize_t length, char *Name, unsigned int number) |
| Initialises a MTD block. | |
| int | build_sram_config (struct axis_pci_device_entry *device) |
| Read the table defined in sram_config and convert it to a set of memory devices. | |
| void | delete_sram_config (struct axis_pci_device_entry *device) |
| Removes any SRAM devices created. | |
Variables | |
| file_operations | ram_file_operations |
|
||||||||||||||||||||
|
Provides an interface to allow user land to control sram read/write.
To allow user applications options other then read / write the driver support IOCTL calls the type constants are defined in axis.h |
Here is the call graph for this function:

|
||||||||||||||||
|
handles user lseek calls for SRAM devices.
Called by kernel in response to a user application making a llseek call. Resets the file_ptrs f_pos element to new position |
|
||||||||||||
|
handles a user mmap request.
Called by kernel in response to a user application making a mmap call. Enables read / write for SRAM partition and then remaps the requested memory block into the user applications address space so it can access it. |
|
||||||||||||
|
open function for sram partition character support
This open is called from the general open after its worked out what type of subdevice user space has requested Called if we have an open on an Axis SRAM block (note the axis device has one set of entry points and sub classes itself on device open by using the TYPE nibble from the minor number and replacing the file ops structure in the file *. Function checks that the SRAM region is accessible. |
|
||||||||||||||||||||
|
Gets data from a SRAM partition and returns it to userland.
Called by kernel in response to a user application making a read call. Note the user buffer pointer is not a valid address from inside the kernel. Reads a block of SRAM from PCI SRAM back to user space with file l ike semantics |
|
||||||||||||
|
Called by kernel in response to a process closing a device.
|
|
||||||||||||||||||||
|
Copies data from USER space and sends it to SRAM.
Called by the kernel in response to a write call by a user application. Note the buffer address supplied will not be a valid kernel address |
|
|
Read the table defined in sram_config and convert it to a set of memory devices.
The SRAM configuration is compiled into the axis_sram_config structure this function reads the structure and creates partitions and devices according to the elements found there. Note at current if more than one MTD device is defined the MTD system seems to cause a kernel panic when the second MTD device is removed this happens in response to a module unload triggered by a rmmod axis command. |
Here is the call graph for this function:

|
||||||||||||
|
|
Here is the call graph for this function:

|
|
Creates a /proc directory fills it entries that output the current SRAM configuration.
|
Here is the call graph for this function:

|
||||||||||||
|
|
|
|
Deletes the SRAM related entries in the /Proc filesystem.
|
Here is the call graph for this function:

|
|
Removes any SRAM devices created.
Called if the driver is unloaded this destroys the drivers it created. Note at current if more than one MTD device is defined the MTD system seems to cause a kernel panic when the second MTD device is removed this happens in response to a module unload triggered by a rmmod axis command. |
|
|
|
|
|
|
|
||||||||||||||||||||
|
|
Here is the call graph for this function:

|
||||||||||||||||||||
|
Initialises a MTD block.
|
Here is the call graph for this function:

|
||||||||||||||||
|
|
Here is the call graph for this function:

|
||||||||||||
|
Function to simulate erasing flash for MTD subsystem.
|
Here is the call graph for this function:

|
||||||||||||||||||||||||
|
passed to MTD system
|
Here is the call graph for this function:

|
||||||||||||||||||||||||
|
Ram read for MTD sub system.
|
Here is the call graph for this function:

|
||||||||||||||||||||
|
passed to MTD system
|
Here is the call graph for this function:

|
||||||||||||||||||||||||
|
Rather than messing about with the SRAM let the Linux MTD support handle it.
|
Here is the call graph for this function:

|
||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||
|
Outputs data about the current SRAM configuration.
|
|
||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
Here is the call graph for this function:

|
||||||||||||||||||||
|
|
Here is the call graph for this function:

|
||||||||||||
|
|
Here is the call graph for this function:

|
||||||||||||||||
|
|
Here is the call graph for this function:

|
||||||||||||
|
|
Here is the call graph for this function:

|
|
|
|
|
Initial value:
{
llseek: axis_ram_llseek,
read: axis_ram_read,
write: axis_ram_write,
ioctl: axis_ram_ioctl,
mmap: axis_ram_mmap,
open: axis_ram_open,
release: axis_ram_release,
}
|
1.3.6