xref: /freebsd/sys/dev/sdio/sdio_if.m (revision 031beb4e)
167ca7330SBjoern A. Zeeb#-
267ca7330SBjoern A. Zeeb# Copyright (c) 2019 The FreeBSD Foundation
367ca7330SBjoern A. Zeeb#
467ca7330SBjoern A. Zeeb# Portions of this software were developed by Björn Zeeb
567ca7330SBjoern A. Zeeb# under sponsorship from the FreeBSD Foundation.
667ca7330SBjoern A. Zeeb#
767ca7330SBjoern A. Zeeb# Redistribution and use in source and binary forms, with or without
867ca7330SBjoern A. Zeeb# modification, are permitted provided that the following conditions
967ca7330SBjoern A. Zeeb# are met:
1067ca7330SBjoern A. Zeeb# 1. Redistributions of source code must retain the above copyright
1167ca7330SBjoern A. Zeeb#    notice, this list of conditions and the following disclaimer.
1267ca7330SBjoern A. Zeeb# 2. Redistributions in binary form must reproduce the above copyright
1367ca7330SBjoern A. Zeeb#    notice, this list of conditions and the following disclaimer in the
1467ca7330SBjoern A. Zeeb#    documentation and/or other materials provided with the distribution.
1567ca7330SBjoern A. Zeeb#
1667ca7330SBjoern A. Zeeb# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1767ca7330SBjoern A. Zeeb# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1867ca7330SBjoern A. Zeeb# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1967ca7330SBjoern A. Zeeb# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2067ca7330SBjoern A. Zeeb# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2167ca7330SBjoern A. Zeeb# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2267ca7330SBjoern A. Zeeb# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2367ca7330SBjoern A. Zeeb# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2467ca7330SBjoern A. Zeeb# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2567ca7330SBjoern A. Zeeb# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2667ca7330SBjoern A. Zeeb#
2767ca7330SBjoern A. Zeeb#
2867ca7330SBjoern A. Zeeb
2967ca7330SBjoern A. Zeeb#include <sys/bus.h>
3067ca7330SBjoern A. Zeeb#include <machine/bus.h>
3167ca7330SBjoern A. Zeeb
3267ca7330SBjoern A. ZeebINTERFACE sdio;
3367ca7330SBjoern A. Zeeb
3467ca7330SBjoern A. Zeeb#
3567ca7330SBjoern A. Zeeb# READ DIRECT (1byte)
3667ca7330SBjoern A. Zeeb#
3767ca7330SBjoern A. ZeebMETHOD int read_direct {
3867ca7330SBjoern A. Zeeb	device_t dev;
3967ca7330SBjoern A. Zeeb	uint8_t fn;
4067ca7330SBjoern A. Zeeb	uint32_t addr;
4167ca7330SBjoern A. Zeeb	uint8_t *val;
4267ca7330SBjoern A. Zeeb};
4367ca7330SBjoern A. Zeeb
4467ca7330SBjoern A. Zeeb#
4567ca7330SBjoern A. Zeeb# WRITE DIRECT (1byte)
4667ca7330SBjoern A. Zeeb#
4767ca7330SBjoern A. ZeebMETHOD int write_direct {
4867ca7330SBjoern A. Zeeb	device_t dev;
4967ca7330SBjoern A. Zeeb	uint8_t fn;
5067ca7330SBjoern A. Zeeb	uint32_t addr;
5167ca7330SBjoern A. Zeeb	uint8_t val;
5267ca7330SBjoern A. Zeeb};
5367ca7330SBjoern A. Zeeb
5467ca7330SBjoern A. Zeeb#
5567ca7330SBjoern A. Zeeb# READ EXTENDED
5667ca7330SBjoern A. Zeeb#
5767ca7330SBjoern A. ZeebMETHOD int read_extended {
5867ca7330SBjoern A. Zeeb	device_t dev;
5967ca7330SBjoern A. Zeeb	uint8_t fn;
6067ca7330SBjoern A. Zeeb	uint32_t addr;
6167ca7330SBjoern A. Zeeb	uint32_t size;
6267ca7330SBjoern A. Zeeb	uint8_t *buffer;
6367ca7330SBjoern A. Zeeb	bool incaddr;
6467ca7330SBjoern A. Zeeb};
6567ca7330SBjoern A. Zeeb
6667ca7330SBjoern A. Zeeb#
6767ca7330SBjoern A. Zeeb# WRITE EXTENDED
6867ca7330SBjoern A. Zeeb#
6967ca7330SBjoern A. ZeebMETHOD int write_extended {
7067ca7330SBjoern A. Zeeb	device_t dev;
7167ca7330SBjoern A. Zeeb	uint8_t fn;
7267ca7330SBjoern A. Zeeb	uint32_t addr;
7367ca7330SBjoern A. Zeeb	uint32_t size;
7467ca7330SBjoern A. Zeeb	uint8_t *buffer;
7567ca7330SBjoern A. Zeeb	bool incaddr;
7667ca7330SBjoern A. Zeeb};
7767ca7330SBjoern A. Zeeb
7867ca7330SBjoern A. Zeeb# end
79