Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/drivers/net/wireless/ti/wl18xx/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 1 kB image not shown  

Quelle  io.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0-only
/*
 * This file is part of wl18xx
 *
 * Copyright (C) 2011 Texas Instruments
 */


#include "../wlcore/wlcore.h"
#include "../wlcore/io.h"

#include "io.h"

int wl18xx_top_reg_write(struct wl1271 *wl, int addr, u16 val)
{
 u32 tmp;
 int ret;

 if (WARN_ON(addr % 2))
  return -EINVAL;

 if ((addr % 4) == 0) {
  ret = wlcore_read32(wl, addr, &tmp);
  if (ret < 0)
   goto out;

  tmp = (tmp & 0xffff0000) | val;
  ret = wlcore_write32(wl, addr, tmp);
 } else {
  ret = wlcore_read32(wl, addr - 2, &tmp);
  if (ret < 0)
   goto out;

  tmp = (tmp & 0xffff) | (val << 16);
  ret = wlcore_write32(wl, addr - 2, tmp);
 }

out:
 return ret;
}

int wl18xx_top_reg_read(struct wl1271 *wl, int addr, u16 *out)
{
 u32 val = 0;
 int ret;

 if (WARN_ON(addr % 2))
  return -EINVAL;

 if ((addr % 4) == 0) {
  /* address is 4-bytes aligned */
  ret = wlcore_read32(wl, addr, &val);
  if (ret >= 0 && out)
   *out = val & 0xffff;
 } else {
  ret = wlcore_read32(wl, addr - 2, &val);
  if (ret >= 0 && out)
   *out = (val & 0xffff0000) >> 16;
 }

 return ret;
}

Messung V0.5
C=95 H=93 G=93

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.